From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/user32/focus.c | 2 +- dlls/win32u/window.c | 6 +++--- dlls/winemac.drv/window.c | 8 ++++---- dlls/winex11.drv/event.c | 6 +++--- include/ntuser.h | 12 ++++++------ 5 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c index 7e1536ab802..bf80777ca97 100644 --- a/dlls/user32/focus.c +++ b/dlls/user32/focus.c @@ -37,7 +37,7 @@ */ BOOL WINAPI SetForegroundWindow( HWND hwnd ) { - return NtUserSetForegroundWindow( hwnd, FALSE ); + return NtUserSetForegroundWindow( hwnd ); }
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 431686bdcaa..42274905d5b 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5403,6 +5403,9 @@ ULONG_PTR WINAPI NtUserCallHwnd( HWND hwnd, DWORD code ) case NtUserCallHwnd_IsWindowVisible: return is_window_visible( hwnd );
+ case NtUserCallHwnd_SetForegroundWindow: + return set_foreground_window( hwnd, FALSE ); + default: FIXME( "invalid code %u\n", code ); return 0; @@ -5489,9 +5492,6 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) case NtUserCallHwndParam_ScreenToClient: return screen_to_client( hwnd, (POINT *)param );
- case NtUserCallHwndParam_SetForegroundWindow: - return set_foreground_window( hwnd, param ); - case NtUserCallHwndParam_SetWindowContextHelpId: return set_window_context_help_id( hwnd, param );
diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index 9d778f427b0..22c250c1d18 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -2350,7 +2350,7 @@ void macdrv_window_got_focus(HWND hwnd, const macdrv_event *event) if (ma != MA_NOACTIVATEANDEAT && ma != MA_NOACTIVATE) { TRACE("setting foreground window to %p\n", hwnd); - NtUserSetForegroundWindow(hwnd, FALSE); + NtUserSetForegroundWindow(hwnd); return; } } @@ -2375,7 +2375,7 @@ void macdrv_window_lost_focus(HWND hwnd, const macdrv_event *event) { send_message(hwnd, WM_CANCELMODE, 0, 0); if (hwnd == NtUserGetForegroundWindow()) - NtUserSetForegroundWindow(NtUserGetDesktopWindow(), FALSE); + NtUserSetForegroundWindow(NtUserGetDesktopWindow()); } }
@@ -2404,7 +2404,7 @@ void macdrv_app_deactivated(void) if (get_active_window() == NtUserGetForegroundWindow()) { TRACE("setting fg to desktop\n"); - NtUserSetForegroundWindow(NtUserGetDesktopWindow(), FALSE); + NtUserSetForegroundWindow(NtUserGetDesktopWindow()); } }
@@ -2573,7 +2573,7 @@ void macdrv_window_drag_begin(HWND hwnd, const macdrv_event *event) if (ma != MA_NOACTIVATEANDEAT && ma != MA_NOACTIVATE) { TRACE("setting foreground window to %p\n", hwnd); - NtUserSetForegroundWindow(hwnd, FALSE); + NtUserSetForegroundWindow(hwnd); } }
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index f81d2338faf..cbfb228ea09 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -596,7 +596,7 @@ static void set_focus( Display *display, HWND hwnd, Time time ) GUITHREADINFO threadinfo;
TRACE( "setting foreground window to %p\n", hwnd ); - NtUserSetForegroundWindow( hwnd, FALSE ); + NtUserSetForegroundWindow( hwnd );
threadinfo.cbSize = sizeof(threadinfo); NtUserGetGUIThreadInfo( 0, &threadinfo ); @@ -812,7 +812,7 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev ) if (!hwnd) hwnd = x11drv_thread_data()->last_focus; if (hwnd && can_activate_window(hwnd)) set_focus( event->display, hwnd, CurrentTime ); } - else NtUserSetForegroundWindow( hwnd, FALSE ); + else NtUserSetForegroundWindow( hwnd ); return TRUE; }
@@ -858,7 +858,7 @@ static void focus_out( Display *display , HWND hwnd ) if (hwnd == NtUserGetForegroundWindow()) { TRACE( "lost focus, setting fg to desktop\n" ); - NtUserSetForegroundWindow( NtUserGetDesktopWindow(), FALSE ); + NtUserSetForegroundWindow( NtUserGetDesktopWindow() ); } } } diff --git a/include/ntuser.h b/include/ntuser.h index 1f3cc2f2e7e..0904aadff0f 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -983,6 +983,7 @@ enum NtUserCallHwnd_IsWindowEnabled, NtUserCallHwnd_IsWindowUnicode, NtUserCallHwnd_IsWindowVisible, + NtUserCallHwnd_SetForegroundWindow, };
static inline UINT NtUserArrangeIconicWindows( HWND parent ) @@ -1041,6 +1042,11 @@ static inline BOOL NtUserIsWindowVisible( HWND hwnd ) return NtUserCallHwnd( hwnd, NtUserCallHwnd_IsWindowVisible ); }
+static inline BOOL NtUserSetForegroundWindow( HWND hwnd ) +{ + return NtUserCallHwnd( hwnd, NtUserCallHwnd_SetForegroundWindow ); +} + /* NtUserCallHwndParam codes, not compatible with Windows */ enum { @@ -1067,7 +1073,6 @@ enum NtUserCallHwndParam_MirrorRgn, NtUserCallHwndParam_MonitorFromWindow, NtUserCallHwndParam_ScreenToClient, - NtUserCallHwndParam_SetForegroundWindow, NtUserCallHwndParam_SetWindowContextHelpId, NtUserCallHwndParam_SetWindowPixelFormat, NtUserCallHwndParam_ShowOwnedPopups, @@ -1207,11 +1212,6 @@ static inline BOOL NtUserScreenToClient( HWND hwnd, POINT *pt ) return NtUserCallHwndParam( hwnd, (UINT_PTR)pt, NtUserCallHwndParam_ScreenToClient ); }
-static inline BOOL NtUserSetForegroundWindow( HWND hwnd, BOOL mouse ) -{ - return NtUserCallHwndParam( hwnd, mouse, NtUserCallHwndParam_SetForegroundWindow ); -} - static inline BOOL NtUserSetWindowContextHelpId( HWND hwnd, DWORD id ) { return NtUserCallHwndParam( hwnd, id, NtUserCallHwndParam_SetWindowContextHelpId );