This is the mail archive of the cygwin-xfree mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch 7/7] Cygwin/X: Unmap windows when they are minimized and map them again when the are restored


At the moment, when a window is minimized, it is moved to (0,0) on the shadow
framebuffer.  This can leads to various problems: tooltips and menus can 'punch
through' from an apparently minimized window if the mouse pointer is positioned
over the native frame of another X window which covers the sensitive regions of
the apparently minimized window.  I think  may also be leading to some repainting
glitches when uncovering areas covered by native window frames.

This has the disadvantage that the contents of windows which are minimized are
no longer stored in the shadow frame buffer, so must be redrawn when restored.
Turning on backingstore might help with this...

---
 xserver/hw/xwin/winmultiwindowwindow.c  |    6 ------
 xserver/hw/xwin/winmultiwindowwm.c      |    3 +++
 xserver/hw/xwin/winmultiwindowwndproc.c |   29 ++++++++++++++++++++++++++++-
 3 files changed, 31 insertions(+), 7 deletions(-)

Index: xorg-server-1.5.3/xserver/hw/xwin/winmultiwindowwindow.c
===================================================================
--- xorg-server-1.5.3.orig/xserver/hw/xwin/winmultiwindowwindow.c	2009-01-13 01:17:58.000000000 +0000
+++ xorg-server-1.5.3/xserver/hw/xwin/winmultiwindowwindow.c	2009-01-13 01:23:44.000000000 +0000
@@ -309,12 +309,6 @@
   WIN_UNWRAP(UnrealizeWindow); 
   fResult = (*pScreen->UnrealizeWindow)(pWin);
   WIN_WRAP(UnrealizeWindow, winUnmapWindowMultiWindow);
-  
-  /* Flag that the window has been killed */
-  pWinPriv->fXKilled = TRUE;
- 
-  /* Destroy the Windows window associated with this X window */
-  winDestroyWindowsWindow (pWin);
 
   return fResult;
 }
Index: xorg-server-1.5.3/xserver/hw/xwin/winmultiwindowwndproc.c
===================================================================
--- xorg-server-1.5.3.orig/xserver/hw/xwin/winmultiwindowwndproc.c	2009-01-13 01:17:58.000000000 +0000
+++ xorg-server-1.5.3/xserver/hw/xwin/winmultiwindowwndproc.c	2009-01-13 01:23:44.000000000 +0000
@@ -1012,7 +1012,34 @@
 #endif
       /* Adjust the X Window to the moved Windows window */
       winAdjustXWindow (pWin, hwnd);
-      if (wParam == SIZE_MINIMIZED) winReorderWindowsMultiWindow();
+
+      switch (wParam)
+        {
+        case SIZE_MINIMIZED:
+          {
+            wmMsg.msg = WM_WM_UNMAP;
+            /* Tell our Window Manager thread to unmap the window */
+            if (fWMMsgInitialized)
+              winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
+
+            winReorderWindowsMultiWindow();
+
+            break;
+          }
+        case SIZE_RESTORED:
+        case SIZE_MAXIMIZED:
+          {
+            wmMsg.msg = WM_WM_MAP;
+            /* Tell our Window Manager thread to map the window */
+            if (fWMMsgInitialized)
+              winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
+
+            winReorderWindowsMultiWindow();
+
+            break;
+          }
+        }
+
       return 0; /* end of WM_SIZE handler */
 
     case WM_STYLECHANGED:
Index: xorg-server-1.5.3/xserver/hw/xwin/winmultiwindowwm.c
===================================================================
--- xorg-server-1.5.3.orig/xserver/hw/xwin/winmultiwindowwm.c	2009-01-13 01:22:58.000000000 +0000
+++ xorg-server-1.5.3/xserver/hw/xwin/winmultiwindowwm.c	2009-01-13 01:24:54.000000000 +0000
@@ -712,6 +712,9 @@
 	  UpdateName (pWMInfo, pNode->msg.iWindow);
 	  winUpdateIcon (pNode->msg.iWindow);
 
+	  /* Map the window */
+	  XMapWindow(pWMInfo->pDisplay, pNode->msg.iWindow);
+
 	  break;
 
 	case WM_WM_MAP2:

-- 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]