[3/3] user32: Don't perform SetWindowPos synchronously.

Dmitry Timoshkov dmitry at baikal.ru
Mon Apr 27 01:37:42 CDT 2015


---
 dlls/user32/message.c      |  5 -----
 dlls/user32/spy.c          |  1 -
 dlls/user32/tests/msg.c    |  6 ++----
 dlls/user32/user_private.h |  1 -
 dlls/user32/winpos.c       | 10 ++--------
 5 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index 2b544de..18673c4 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -848,7 +848,6 @@ static size_t pack_message( HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara
         push_data( data, &data->ps.cis, sizeof(data->ps.cis) );
         return 0;
     }
-    case WM_WINE_SETWINDOWPOS:
     case WM_WINDOWPOSCHANGING:
     case WM_WINDOWPOSCHANGED:
     {
@@ -1214,7 +1213,6 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa
     }
     case WM_WINDOWPOSCHANGING:
     case WM_WINDOWPOSCHANGED:
-    case WM_WINE_SETWINDOWPOS:
     {
         WINDOWPOS wp;
         if (size < sizeof(ps->wp)) return FALSE;
@@ -1856,9 +1854,6 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR
     {
     case WM_WINE_DESTROYWINDOW:
         return WIN_DestroyWindow( hwnd );
-    case WM_WINE_SETWINDOWPOS:
-        if (is_desktop_window( hwnd )) return 0;
-        return USER_SetWindowPos( (WINDOWPOS *)lparam );
     case WM_WINE_SHOWWINDOW:
         if (is_desktop_window( hwnd )) return 0;
         return ShowWindow( hwnd, wparam );
diff --git a/dlls/user32/spy.c b/dlls/user32/spy.c
index 65b448d..bf7695a 100644
--- a/dlls/user32/spy.c
+++ b/dlls/user32/spy.c
@@ -1132,7 +1132,6 @@ static const char * const CCMMessageTypeNames[SPY_MAX_CCMMSGNUM + 1] =
 static const char * const WINEMessageTypeNames[SPY_MAX_WINEMSGNUM + 1] =
 {
     "WM_WINE_DESTROYWINDOW",
-    "WM_WINE_SETWINDOWPOS",
     "WM_WINE_SHOWWINDOW",
     "WM_WINE_SETPARENT",
     "WM_WINE_SETWINDOWLONG",
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index f2ba805..96bc680 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -14827,7 +14827,7 @@ static void test_SetWindowPos_other_thread(void)
 
     trace("main: call PeekMessage\n");
     ok(!PeekMessageA(&msg, 0, 0, 0, PM_REMOVE), "PeekMessage should fail\n");
-    ok_sequence(swp_1, "SetWindowPos from other thread 1", TRUE);
+    ok_sequence(swp_1, "SetWindowPos from other thread 1", FALSE);
 
     /* wait for other thread's SendMessage */
     timeout = 0;
@@ -14839,19 +14839,17 @@ static void test_SetWindowPos_other_thread(void)
         timeout += 50;
         if (timeout > 500)
         {
-todo_wine
             ok(0, "time out waiting for SendMessage from other thread\n");
             break;
         }
     }
 
     ret = GetQueueStatus(QS_SENDMESSAGE|QS_POSTMESSAGE);
-todo_wine
     ok(ret == MAKELONG(0, QS_SENDMESSAGE), "wrong status %08x\n", ret);
 
     trace("main: call PeekMessage\n");
     ok(!PeekMessageA(&msg, 0, 0, 0, PM_REMOVE), "PeekMessage should fail\n");
-    ok_sequence(swp_2, "SetWindowPos from other thread 2", TRUE);
+    ok_sequence(swp_2, "SetWindowPos from other thread 2", FALSE);
 
     /* intentionally yield */
     MsgWaitForMultipleObjects(0, NULL, FALSE, 100, qs_all_input);
diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h
index 7f359e6..4437bd8 100644
--- a/dlls/user32/user_private.h
+++ b/dlls/user32/user_private.h
@@ -44,7 +44,6 @@ struct window_surface;
 enum wine_internal_message
 {
     WM_WINE_DESTROYWINDOW = 0x80000000,
-    WM_WINE_SETWINDOWPOS,
     WM_WINE_SHOWWINDOW,
     WM_WINE_SETPARENT,
     WM_WINE_SETWINDOWLONG,
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index f92a3dc..1ce056b 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -2289,11 +2289,8 @@ BOOL WINAPI SetWindowPos( HWND hwnd, HWND hwndInsertAfter,
     winpos.cx = cx;
     winpos.cy = cy;
     winpos.flags = flags;
-    
-    if (WIN_IsCurrentThread( hwnd ))
-        return USER_SetWindowPos(&winpos);
 
-    return SendMessageW( winpos.hwnd, WM_WINE_SETWINDOWPOS, 0, (LPARAM)&winpos );
+    return USER_SetWindowPos(&winpos);
 }
 
 
@@ -2436,10 +2433,7 @@ BOOL WINAPI EndDeferWindowPos( HDWP hdwp )
                winpos->hwnd, winpos->hwndInsertAfter, winpos->x, winpos->y,
                winpos->cx, winpos->cy, winpos->flags);
 
-        if (WIN_IsCurrentThread( winpos->hwnd ))
-            res = USER_SetWindowPos( winpos );
-        else
-            res = SendMessageW( winpos->hwnd, WM_WINE_SETWINDOWPOS, 0, (LPARAM)winpos );
+        res = USER_SetWindowPos( winpos );
     }
     HeapFree( GetProcessHeap(), 0, pDWP->winPos );
     HeapFree( GetProcessHeap(), 0, pDWP );
-- 
2.3.5




More information about the wine-patches mailing list