winex11.drv: When minimizing a top level window move it outside of the visible desktop area
Dmitry Timoshkov
dmitry at codeweavers.com
Wed Sep 19 06:08:50 CDT 2007
Hello,
please apply after the dialog minimizing test case.
Changelog:
winex11.drv: When minimizing a top level window move it outside of
the visible desktop area.
---
dlls/user32/tests/msg.c | 2 +-
dlls/winex11.drv/winpos.c | 16 +++++++++++++---
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 70aa2a7..dd68197 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -9184,7 +9184,7 @@ static INT_PTR WINAPI test_dlg_proc(HWND hwnd, UINT message, WPARAM wParam, LPAR
ok(GetWindowLong(hwnd, GWL_STYLE) & WS_VISIBLE, "dialog should be visible\n");
ok(GetWindowLong(hwnd, GWL_STYLE) & WS_MINIMIZE, "dialog should be minimized\n");
GetWindowRect(hwnd, &rc);
-todo_wine ok((rc.left == -32000 && rc.top == -32000) /* XP*/ ||
+ ok((rc.left == -32000 && rc.top == -32000) /* XP*/ ||
(rc.left == 3000 && rc.top == 3000), /* Win9x*/
"expected -32000,-32000 (XP) or 3000,3000 (Win9x) got %d,%d\n", rc.left, rc.top);
diff --git a/dlls/winex11.drv/winpos.c b/dlls/winex11.drv/winpos.c
index 085396c..9620758 100644
--- a/dlls/winex11.drv/winpos.c
+++ b/dlls/winex11.drv/winpos.c
@@ -525,6 +525,9 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect )
case SW_SHOWMINIMIZED:
case SW_FORCEMINIMIZE:
case SW_MINIMIZE:
+ {
+ int x, y;
+
if (!(wndPtr = WIN_GetPtr( hwnd )) || wndPtr == WND_OTHER_PROCESS) return 0;
if( wndPtr->dwStyle & WS_MAXIMIZE) wndPtr->flags |= WIN_RESTORE_MAX;
else wndPtr->flags &= ~WIN_RESTORE_MAX;
@@ -534,13 +537,20 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect )
X11DRV_set_iconic_state( hwnd );
- wpl.ptMinPosition = WINPOS_FindIconPos( hwnd, wpl.ptMinPosition );
-
if (!(old_style & WS_MINIMIZE)) swpFlags |= SWP_STATECHANGED;
- SetRect( rect, wpl.ptMinPosition.x, wpl.ptMinPosition.y,
+ if (old_style & WS_CHILD)
+ {
+ wpl.ptMinPosition = WINPOS_FindIconPos( hwnd, wpl.ptMinPosition );
+ x = wpl.ptMinPosition.x;
+ y = wpl.ptMinPosition.y;
+ }
+ else
+ x = y = -32000;
+ SetRect( rect, x, y,
GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON) );
swpFlags |= SWP_NOCOPYBITS;
break;
+ }
case SW_MAXIMIZE:
old_style = GetWindowLongW( hwnd, GWL_STYLE );
--
1.5.3.1
More information about the wine-patches
mailing list