discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix for window flicks when getting focused


From: Yen-Ju Chen
Subject: Fix for window flicks when getting focused
Date: Wed, 29 Aug 2007 16:23:12 -0700

This patch tries to fix the GNUstep window flicks when it gets focus.
This is the situation I traced:
1) A GNUstep window get focused.
2) [XGServerWindow orderwindow:::] receives NSWindowAbove with otherwin == 0.
3) It uses XGetInputFocus() and it succeeds because there is one
window has focus (may not be the GNUstep window).
4) The GNUstep window is actually lowered because NSWindowAbove
becomes NSWindowBelow.
5) Later, this window get focused again and raise again.

Due to step 4 and 5, the GNUstep window is lowered and raised in short time,
which creates the flicks.
The patch is not meant to be applied directly, but shows the problem.

Yen-Ju

===================================================================
--- Source/x11/XGServerWindow.m (revision 25425)
+++ Source/x11/XGServerWindow.m (working copy)
@@ -2733,10 +2733,18 @@
       /* Don't let the window go in front of the current key/main window.  */
       /* FIXME: Don't know how to get the current main window.  */
       Window keywin;
+      NSWindow *keyWin = [NSApp keyWindow];
+      NSWindow *mainWin = [NSApp mainWindow];
+         NSWindow *nswin = GSWindowWithNumber(window->number);
+
       int revert, status;
       status = XGetInputFocus(dpy, &keywin, &revert);
       other = NULL;
+#if 1
+      if ((keyWin) && (keyWin != nswin))
+#else
       if (status == True)
+#endif
        {
          /* Alloc a temporary window structure */
          other = GSAutoreleasedBuffer(sizeof(gswindow_device_t));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]