< prev index next >
src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c
Print this page
*** 41,51 ****
#include <jni.h>
#include <jni_util.h>
#include <jvm.h>
#include <jvm_md.h>
#include <jlong.h>
!
#include <stdlib.h>
#include "awt_GraphicsEnv.h"
#include "awt_util.h"
#include "gdefs.h"
--- 41,51 ----
#include <jni.h>
#include <jni_util.h>
#include <jvm.h>
#include <jvm_md.h>
#include <jlong.h>
! #include "systemScale.h"
#include <stdlib.h>
#include "awt_GraphicsEnv.h"
#include "awt_util.h"
#include "gdefs.h"
*** 2081,2101 ****
/**
* End DisplayMode/FullScreen support
*/
- int getScale(const char *name) {
- char *uiScale = getenv(name);
- if (uiScale != NULL) {
- double scale = strtod(uiScale, NULL);
- if (errno == ERANGE || scale < 1) {
- return -1;
- }
- return (int) scale;
- }
- return -1;
- }
/*
* Class: sun_awt_X11GraphicsDevice
* Method: getNativeScaleFactor
* Signature: (I)I
--- 2081,2090 ----
*** 2106,2119 ****
// for debug purposes
static int scale = -2.0;
if (scale == -2) {
! scale = getScale("J2D_UISCALE");
}
if (scale >= 1) {
return scale;
}
! return getScale("GDK_SCALE");
}
--- 2095,2108 ----
// for debug purposes
static int scale = -2.0;
if (scale == -2) {
! scale = getNativeScaleFactor("J2D_UISCALE");
}
if (scale >= 1) {
return scale;
}
! return getNativeScaleFactor("GDK_SCALE");
}
< prev index next >