aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-10-09 01:54:32 +0200
committerSven Gothel <[email protected]>2015-10-09 01:54:32 +0200
commite418a665756af52fe2ca691ca220644e9b27c22c (patch)
tree5aad1e3803b5cbf177b591912985d992afec6894 /src/newt/classes
parentdca5d36370ec5eb44998bae593880e3b10cc9a4e (diff)
Bug 1249 - NEWT X11: setVisible(*) _NET_WM_STATE_HIDDEN update not received at ConfigureNotify event (2)
On gnome shell WM, sometimes KDE WM, it has been observed that the _NET_WM_STATE_HIDDEN update (visible or invisible) is not received at ConfigureNotify event. Turns out the state is finally updated at FocusOut! This change tests _NET_WM_STATE_HIDDEN visibility hint for mapped window also for FocusIn and FocusOut events, besides the ConfigureNotify event. Further more, NormalState to restore a hidden but mapped window did not work, so it is no more being sent. We limit us here to _NET_ACTIVE_WINDOW. 2 unit tests are prepared to test this issue: - TestGLWindows00NEWT - TestParenting01NEWT
Diffstat (limited to 'src/newt/classes')
-rw-r--r--src/newt/classes/jogamp/newt/WindowImpl.java48
1 files changed, 41 insertions, 7 deletions
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index 922b75a2e..8fe3dceca 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -96,11 +96,12 @@ import com.jogamp.newt.event.WindowUpdateEvent;
public abstract class WindowImpl implements Window, NEWTEventConsumer
{
public static final boolean DEBUG_TEST_REPARENT_INCOMPATIBLE;
+ private static final boolean DEBUG_FREEZE_AT_VISIBILITY_FAILURE;
static {
Debug.initSingleton();
DEBUG_TEST_REPARENT_INCOMPATIBLE = PropertyAccess.isPropertyDefined("newt.test.Window.reparent.incompatible", true);
-
+ DEBUG_FREEZE_AT_VISIBILITY_FAILURE = PropertyAccess.isPropertyDefined("newt.debug.Window.visibility.failure.freeze", true);
ScreenImpl.initSingleton();
}
@@ -4420,14 +4421,30 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
if( visible != _visible ) {
final String msg = "Visibility not reached as requested within "+timeOut+"ms : requested "+visible+", is "+_visible;
- if(failFast) {
+ if(DEBUG_FREEZE_AT_VISIBILITY_FAILURE) {
+ System.err.println("XXXX: "+msg);
+ System.err.println("XXXX: FREEZE");
+ try {
+ while(true) {
+ Thread.sleep(1000);
+ }
+ } catch (final InterruptedException e) {
+ ExceptionUtils.dumpThrowable("", e);
+ Thread.currentThread().interrupt(); // keep state
+ }
throw new NativeWindowException(msg);
- } else if (DEBUG_IMPLEMENTATION) {
- System.err.println(msg);
- ExceptionUtils.dumpStack(System.err);
+ } else {
+ if(failFast) {
+ throw new NativeWindowException(msg);
+ } else {
+ if (DEBUG_IMPLEMENTATION) {
+ System.err.println(msg);
+ ExceptionUtils.dumpStack(System.err);
+ }
+ return -1;
+ }
}
- return -1;
- } else if( 0 < remaining ){
+ } else if( 0 < remaining ) {
return remaining;
} else {
return 0;
@@ -4704,6 +4721,23 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* Triggered by implementation's WM events to update the client-area position, size, insets and maximized flags.
*
* @param defer
+ * @param focusChange -1 ignored, 0 unfocused, > 0 focused
+ * @param visibleChange -1 ignored, 0 invisible, > 0 visible
+ */
+ protected final void focusVisibleChanged(final boolean defer,
+ final int focusChange,
+ final int visibleChange) {
+ if( 0 <= focusChange ) { // ignore focus < 0
+ focusChanged(defer, 0 < focusChange);
+ }
+ if( 0 <= visibleChange ) { // ignore visible < 0
+ visibleChanged(defer, 0 < visibleChange);
+ }
+ }
+ /**
+ * Triggered by implementation's WM events to update the client-area position, size, insets and maximized flags.
+ *
+ * @param defer
* @param left insets, -1 ignored
* @param right insets, -1 ignored
* @param top insets, -1 ignored