Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
30ca4624
Commit
30ca4624
authored
8 years ago
by
Anton Tarasov
Browse files
Options
Download
Email Patches
Plain Diff
IDEA-164566 [detect JBRE from launcher]
parent
a3a3310f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/WinLauncher/WinLauncher.exe
+0
-0
bin/WinLauncher/WinLauncher.exe
bin/WinLauncher/WinLauncher64.exe
+0
-0
bin/WinLauncher/WinLauncher64.exe
native/WinLauncher/WinLauncher/WinLauncher.cpp
+13
-6
native/WinLauncher/WinLauncher/WinLauncher.cpp
with
13 additions
and
6 deletions
+13
-6
bin/WinLauncher/WinLauncher.exe
+
0
-
0
View file @
30ca4624
No preview for this file type
This diff is collapsed.
Click to expand it.
bin/WinLauncher/WinLauncher64.exe
+
0
-
0
View file @
30ca4624
No preview for this file type
This diff is collapsed.
Click to expand it.
native/WinLauncher/WinLauncher/WinLauncher.cpp
+
13
-
6
View file @
30ca4624
...
@@ -555,17 +555,24 @@ bool LoadJVMLibrary()
...
@@ -555,17 +555,24 @@ bool LoadJVMLibrary()
return
true
;
return
true
;
}
}
bool
Is
HiDPI
JBRE
()
// JetBrains RE supporting HiDPI
bool
IsJBRE
()
{
{
if
(
!
env
)
return
false
;
if
(
!
env
)
return
false
;
jclass
cls
=
env
->
FindClass
(
"
sun/java2d/SunGraphicsEnvironment
"
);
jclass
cls
=
env
->
FindClass
(
"
java/lang/System
"
);
if
(
!
cls
)
return
false
;
if
(
!
cls
)
return
false
;
jmethodID
method
=
env
->
GetMethodID
(
cls
,
"
isUIScaleOn"
,
"()Z
"
);
jmethodID
method
=
env
->
Get
Static
MethodID
(
cls
,
"
getProperty"
,
"(Ljava/lang/String;)Ljava/lang/String;
"
);
if
(
!
method
)
return
false
;
if
(
!
method
)
return
false
;
return
true
;
jstring
jvendor
=
(
jstring
)
env
->
CallStaticObjectMethod
(
cls
,
method
,
env
->
NewStringUTF
(
"java.vendor"
));
if
(
!
jvendor
)
return
false
;
const
char
*
cvendor
=
env
->
GetStringUTFChars
(
jvendor
,
NULL
);
bool
isJB
=
strstr
(
cvendor
,
"JetBrains"
)
!=
NULL
;
env
->
ReleaseStringUTFChars
(
jvendor
,
cvendor
);
return
isJB
;
}
}
void
SetProcessDPIAwareProperty
()
void
SetProcessDPIAwareProperty
()
...
@@ -612,8 +619,8 @@ bool CreateJVM()
...
@@ -612,8 +619,8 @@ bool CreateJVM()
MessageBoxA
(
NULL
,
buf
.
str
().
c_str
(),
error
.
c_str
(),
MB_OK
);
MessageBoxA
(
NULL
,
buf
.
str
().
c_str
(),
error
.
c_str
(),
MB_OK
);
}
}
// Set DPI-awareness here or let
HiDPI
JBRE do that.
// Set DPI-awareness here or let JBRE do that.
if
(
!
Is
HiDPI
JBRE
())
SetProcessDPIAwareProperty
();
if
(
!
IsJBRE
())
SetProcessDPIAwareProperty
();
return
result
==
JNI_OK
;
return
result
==
JNI_OK
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment