You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by eb...@apache.org on 2021/05/31 18:34:56 UTC
[netbeans] branch master updated: [NETBEANS-5723] Avoid a spurious
error log message when dragging window system tabs on Windows.
This is an automated email from the ASF dual-hosted git repository.
ebakke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 0fb44eb [NETBEANS-5723] Avoid a spurious error log message when dragging window system tabs on Windows.
0fb44eb is described below
commit 0fb44eb02182e92bbb654c67781358c301fada94
Author: Eirik Bakke <eb...@ultorg.com>
AuthorDate: Thu May 27 12:07:45 2021 -0400
[NETBEANS-5723] Avoid a spurious error log message when dragging window system tabs on Windows.
---
.../core/nativeaccess/NativeWindowSystemImpl.java | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/platform/core.nativeaccess/src/org/netbeans/core/nativeaccess/NativeWindowSystemImpl.java b/platform/core.nativeaccess/src/org/netbeans/core/nativeaccess/NativeWindowSystemImpl.java
index 8eb91ae..096743a 100644
--- a/platform/core.nativeaccess/src/org/netbeans/core/nativeaccess/NativeWindowSystemImpl.java
+++ b/platform/core.nativeaccess/src/org/netbeans/core/nativeaccess/NativeWindowSystemImpl.java
@@ -78,18 +78,22 @@ public class NativeWindowSystemImpl extends NativeWindowSystem {
if (gd.isWindowTranslucencySupported(GraphicsDevice.WindowTranslucency.TRANSLUCENT) ) {
try {
w.setOpacity(alpha);
+ return;
} catch( Exception e ) {
//ignore, we'll try JNA
}
}
}
- //try the JNA way
- try {
- WindowUtils.setWindowAlpha(w, alpha);
- } catch( ThreadDeath td ) {
- throw td;
- } catch( Throwable e ) {
- LOG.log(Level.INFO, null, e);
+ // Test isWindowAlphaSupported first to avoid an unnecessary log message.
+ if (WindowUtils.isWindowAlphaSupported()) {
+ //try the JNA way
+ try {
+ WindowUtils.setWindowAlpha(w, alpha);
+ } catch( ThreadDeath td ) {
+ throw td;
+ } catch( Throwable e ) {
+ LOG.log(Level.INFO, null, e);
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists