mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JRE-34 IDE Crashes During Startup
Added validation of dpi settings coming from xserver
(cherry picked from commit b1c49c3b27)
This commit is contained in:
committed by
alexey.ushakov@jetbrains.com
parent
d015aa34ba
commit
3f4dc38eba
@@ -68,6 +68,7 @@
|
||||
#define FT26Dot6ToDouble(x) ((x) / ((double) (1<<6)))
|
||||
#define FT26Dot6ToInt(x) (((int)(x)) >> 6)
|
||||
#define DEFAULT_DPI 72
|
||||
#define MAX_DPI 1024
|
||||
#define ADJUST_FONT_SIZE(X, DPI) (((X)*DEFAULT_DPI + ((DPI)>>1))/(DPI))
|
||||
|
||||
#ifndef _WIN32
|
||||
@@ -249,6 +250,11 @@ static int getScreenResolution(JNIEnv *env) {
|
||||
(*env)->ExceptionClear(env);
|
||||
return DEFAULT_DPI;
|
||||
}
|
||||
|
||||
/* Some configurations report invalid dpi settings */
|
||||
if (dpi > MAX_DPI) {
|
||||
return DEFAULT_DPI;
|
||||
}
|
||||
return dpi;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user