Jacek Caban : win32u: Move more WM_SYSCOMMAND handling from user32.

Alexandre Julliard julliard at winehq.org
Fri Apr 15 15:23:16 CDT 2022


Module: wine
Branch: master
Commit: 35ac1b3f0700b3f6c1b8a9bbb87e9aad37ce3cc6
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=35ac1b3f0700b3f6c1b8a9bbb87e9aad37ce3cc6

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Apr 15 14:54:16 2022 +0200

win32u: Move more WM_SYSCOMMAND handling from user32.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/nonclient.c      | 17 -----------------
 dlls/win32u/defwnd.c         | 22 +++++++++++++++++++++-
 dlls/win32u/win32u_private.h |  1 +
 dlls/win32u/window.c         |  2 +-
 4 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c
index dbcb09875d0..a2b5a82a5e6 100644
--- a/dlls/user32/nonclient.c
+++ b/dlls/user32/nonclient.c
@@ -1550,23 +1550,6 @@ LRESULT NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam )
         WINPOS_SysCommandSizeMove( hwnd, wParam );
         break;
 
-    case SC_MINIMIZE:
-        ShowOwnedPopups(hwnd,FALSE);
-        NtUserShowWindow( hwnd, SW_MINIMIZE );
-        break;
-
-    case SC_MAXIMIZE:
-        if (IsIconic(hwnd))
-            ShowOwnedPopups(hwnd,TRUE);
-        NtUserShowWindow( hwnd, SW_MAXIMIZE );
-        break;
-
-    case SC_RESTORE:
-        if (IsIconic(hwnd))
-            ShowOwnedPopups(hwnd,TRUE);
-        NtUserShowWindow( hwnd, SW_RESTORE );
-        break;
-
     case SC_CLOSE:
         return SendMessageW( hwnd, WM_CLOSE, 0, 0 );
 
diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c
index 22d2b08951d..0080d4f7cc6 100644
--- a/dlls/win32u/defwnd.c
+++ b/dlls/win32u/defwnd.c
@@ -131,7 +131,27 @@ static LRESULT handle_sys_command( HWND hwnd, WPARAM wparam, LPARAM lparam )
     if (!user_driver->pSysCommand( hwnd, wparam, lparam ))
         return 0;
 
-    return 1;
+    switch (wparam & 0xfff0)
+    {
+    case SC_MINIMIZE:
+        show_owned_popups( hwnd, FALSE );
+        NtUserShowWindow( hwnd, SW_MINIMIZE );
+        break;
+
+    case SC_MAXIMIZE:
+        if (is_iconic(hwnd)) show_owned_popups( hwnd, TRUE );
+        NtUserShowWindow( hwnd, SW_MAXIMIZE );
+        break;
+
+    case SC_RESTORE:
+        if (is_iconic( hwnd )) show_owned_popups( hwnd, TRUE );
+        NtUserShowWindow( hwnd, SW_RESTORE );
+        break;
+
+    default:
+        return 1; /* handle on client side */
+    }
+    return 0;
 }
 
 LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL ansi )
diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h
index ceff548526b..651003d4e84 100644
--- a/dlls/win32u/win32u_private.h
+++ b/dlls/win32u/win32u_private.h
@@ -431,6 +431,7 @@ extern LONG_PTR set_window_long( HWND hwnd, INT offset, UINT size, LONG_PTR newv
                                  BOOL ansi ) DECLSPEC_HIDDEN;
 extern BOOL set_window_pos( WINDOWPOS *winpos, int parent_x, int parent_y ) DECLSPEC_HIDDEN;
 extern ULONG set_window_style( HWND hwnd, ULONG set_bits, ULONG clear_bits ) DECLSPEC_HIDDEN;
+extern BOOL show_owned_popups( HWND owner, BOOL show ) DECLSPEC_HIDDEN;
 extern void update_window_state( HWND hwnd ) DECLSPEC_HIDDEN;
 extern HWND window_from_point( HWND hwnd, POINT pt, INT *hittest ) DECLSPEC_HIDDEN;
 
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c
index 49813aa2ad3..ba58dbf96aa 100644
--- a/dlls/win32u/window.c
+++ b/dlls/win32u/window.c
@@ -4238,7 +4238,7 @@ BOOL WINAPI NtUserShowWindow( HWND hwnd, INT cmd )
 }
 
 /* see ShowOwnedPopups */
-static BOOL show_owned_popups( HWND owner, BOOL show )
+BOOL show_owned_popups( HWND owner, BOOL show )
 {
     int count = 0;
     HWND *win_array = list_window_children( 0, get_desktop_window(), NULL, 0 );




More information about the wine-cvs mailing list