[PATCH] user32: Removed 16-bit windows position and size constraints

Kees Beets kbeets68 at gmail.com
Sat Mar 4 07:41:33 CST 2017


Fixes https://bugs.winehq.org/show_bug.cgi?id=38231

Removed code introduced in 2006 to correctly reflect Win9x 16-bit winpos behaviour.
Newer versions of Windows do not have the 16-bit constraint and this code is now
actually causing a bug in Adobe Lightroom on Wine.
I've not used iswin9x to ensure compatibility with Win9x as:
- Applications that can run on Win9x should take care of this
- Adding such code will over time make wine more complex and less performant.

Tested on Ubuntu 16.04, HP Elitebook with AMD A10.
13 failures before change, 10 failures after change. Test code uses iswin9x,
so to have 0 failures means changes to the test suite or further introduction
of 'if isinw9x' logic.

Signed-off-by: kbeets68 at gmail.com
---
 dlls/user32/winpos.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index 2fa194f..50af3d6 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -1918,15 +1918,8 @@ static BOOL fixup_flags( WINDOWPOS *winpos )
     winpos->hwnd = wndPtr->obj.handle;  /* make it a full handle */
 
     /* Finally make sure that all coordinates are valid */
-    if (winpos->x < -32768) winpos->x = -32768;
-    else if (winpos->x > 32767) winpos->x = 32767;
-    if (winpos->y < -32768) winpos->y = -32768;
-    else if (winpos->y > 32767) winpos->y = 32767;
-
     if (winpos->cx < 0) winpos->cx = 0;
-    else if (winpos->cx > 32767) winpos->cx = 32767;
     if (winpos->cy < 0) winpos->cy = 0;
-    else if (winpos->cy > 32767) winpos->cy = 32767;
 
     parent = GetAncestor( winpos->hwnd, GA_PARENT );
     if (!IsWindowVisible( parent )) winpos->flags |= SWP_NOREDRAW;
@@ -2195,19 +2188,10 @@ BOOL USER_SetWindowPos( WINDOWPOS * winpos )
     }
 
     /* Make sure that coordinates are valid for WM_WINDOWPOSCHANGING */
-    if (!(winpos->flags & SWP_NOMOVE))
-    {
-        if (winpos->x < -32768) winpos->x = -32768;
-        else if (winpos->x > 32767) winpos->x = 32767;
-        if (winpos->y < -32768) winpos->y = -32768;
-        else if (winpos->y > 32767) winpos->y = 32767;
-    }
     if (!(winpos->flags & SWP_NOSIZE))
     {
         if (winpos->cx < 0) winpos->cx = 0;
-        else if (winpos->cx > 32767) winpos->cx = 32767;
         if (winpos->cy < 0) winpos->cy = 0;
-        else if (winpos->cy > 32767) winpos->cy = 32767;
     }
 
     if (!SWP_DoWinPosChanging( winpos, &newWindowRect, &newClientRect )) return FALSE;
-- 
2.7.4




More information about the wine-patches mailing list