]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Unity/X11: Don't remove minimized windows from tracker.
authorVMware, Inc <>
Wed, 20 Jan 2010 21:29:29 +0000 (13:29 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Wed, 20 Jan 2010 21:29:29 +0000 (13:29 -0800)
CLN 953276 introduced a regression.  Unregress it.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/unity/unityPlatformX11Window.c

index 527b2a49454ab4989b051f3c7b553a61e0a2089e..e4445c44769d6be3a9d2b41448818f34d4594f86 100644 (file)
@@ -1235,14 +1235,37 @@ UPWindow_CheckRelevance(UnityPlatform *up,        // IN
       }
       upw->isOverrideRedirect = winAttr.override_redirect ? TRUE : FALSE;
 
+      /*
+       * More crazy tests to determine whether a window should be added to the window
+       * tracker.
+       */
+
       if (winAttr.class == InputOnly) {
+         /* This is intrinsically true. */
          isInvisible = TRUE;
-      } else if (!upw->isViewable && onCurrentDesktop) {
+      } else if (!upw->isViewable && onCurrentDesktop && !upw->clientWindow) {
+         /*
+          * Evaluate the map state.  There are reasons why we'd like to keep unmapped
+          * windows in the tracker.
+          *
+          *    1.  The window may be on another desktop.
+          *    2.  The window may be minimized.
+          *
+          * upw->clientWindow == None implies that there is no window in the hierarchy
+          * with a WM_STATE property.  No WM_STATE property means that the window can't
+          * be "minimized".
+          *
+          * I'm using these implications because it saves me from having to explicitly
+          * query for/examine WM_STATE here.
+          */
          isInvisible = TRUE;
       } else if (winAttr.width <= 1 && winAttr.height <= 1) {
          isInvisible = TRUE;
       } else if ((winAttr.x + winAttr.width) < 0
                  || (winAttr.y + winAttr.height) < 0) {
+         /*
+          * XXX This isn't clear to me.  What if winAttr.x > parent's width?
+          */
          isInvisible = TRUE;
       }