[PATCH] zero size client window
Gerard Patel
gerard.patel at nerim.net
Fri Jun 8 07:39:35 CDT 2001
Some apps don't like creating a zero size window and getting back
a not empty client rect.
ChangeLog:
* dlls/x11drv/window.c
When a zero size window is created, client rect should be empty.
-------------- next part --------------
Index: dlls/x11drv/window.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/window.c,v
retrieving revision 1.6
diff -u -r1.6 window.c
--- dlls/x11drv/window.c 2001/06/06 21:26:50 1.6
+++ dlls/x11drv/window.c 2001/06/08 06:26:17
@@ -660,13 +660,26 @@
struct x11drv_win_data *data = win->pDriverData;
RECT rect;
XSetWindowAttributes attr;
+ int cx, cy;
rect = win->rectWindow;
SendMessageW( win->hwndSelf, WM_NCCALCSIZE, FALSE, (LPARAM)&rect );
if (rect.left > rect.right || rect.top > rect.bottom) rect = win->rectWindow;
- if (rect.top >= rect.bottom) rect.bottom = rect.top + 1;
- if (rect.left >= rect.right) rect.right = rect.left + 1;
+ if (rect.left >= rect.right)
+ {
+ rect.right = rect.left;
+ cx = 1;
+ }
+ else
+ cx = rect.right - rect.left;
+ if (rect.top >= rect.bottom)
+ {
+ rect.bottom = rect.top;
+ cy = 1;
+ }
+ else
+ cy = rect.bottom - rect.top;
win->rectClient = rect;
OffsetRect( &rect, -data->whole_rect.left, -data->whole_rect.top );
@@ -680,8 +693,7 @@
data->client_window = TSXCreateWindow( display, data->whole_window,
rect.left, rect.top,
- rect.right - rect.left,
- rect.bottom - rect.top,
+ cx, cy,
0, screen_depth,
InputOutput, visual,
CWEventMask | CWBitGravity | CWBackingStore, &attr );
-------------- next part --------------
More information about the wine-patches
mailing list