[PATCH 04/12] Cygwin/X: When the style changes, adjust the window size so the client area remains the same.

Jon TURNEY jon.turney at dronecode.org.uk
Wed May 20 04:52:22 PDT 2009


When the style changes, adjust the window size so the client area remains the same.
Otherwise the window size may change when sizing is reflected from
Windows to X, and some windows are drawn expecting them to be exactly the requested size
(e.g. gmplayer control window)

Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
---
 hw/xwin/winmultiwindowwndproc.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index 0dd8885..5b50997 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -1027,6 +1027,17 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
       winAdjustXWindow (pWin, hwnd);
       return 0; /* end of WM_SIZE handler */
 
+    case WM_STYLECHANGED:
+      /* when the style changes, adjust the window size so the client area remains the same */
+      {
+	LONG x,y;
+	DrawablePtr pDraw = &pWin->drawable;
+	x = pDraw->x - wBorderWidth(pWin);
+	y = pDraw->y - wBorderWidth(pWin);
+	winPositionWindowMultiWindow(pWin, x, y);
+      }
+      return 0;
+
     case WM_MOUSEACTIVATE:
 
       /* Check if this window needs to be made active when clicked */
-- 
1.6.1.2



More information about the xorg-devel mailing list