Skip to content

Commit

Permalink
8276809: java/awt/font/JNICheck/FreeTypeScalerJNICheck.java shows JNI…
Browse files Browse the repository at this point in the history
… warning on Windows

Reviewed-by: rschmelter, stuefe
  • Loading branch information
MBaesken committed Jan 8, 2024
1 parent 09c6c4f commit 71aac7a
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -126,9 +126,15 @@ BOOL DWMIsCompositionEnabled() {
dwmIsCompositionEnabled = bRes;

JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
JNU_CallStaticMethodByName(env, NULL,
jboolean hasException;
JNU_CallStaticMethodByName(env, &hasException,
"sun/awt/Win32GraphicsEnvironment",
"dwmCompositionChanged", "(Z)V", (jboolean)bRes);
if (hasException) {
J2dTraceLn(J2D_TRACE_INFO, "Exception occurred in DWMIsCompositionEnabled");
env->ExceptionDescribe();
env->ExceptionClear();
}
return bRes;
}

Expand Down

1 comment on commit 71aac7a

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.