Commit 76a0108c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Use NtUserCallHwnd for NtUserSetForegroundWindow.

parent 389832e0
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
*/ */
BOOL WINAPI SetForegroundWindow( HWND hwnd ) BOOL WINAPI SetForegroundWindow( HWND hwnd )
{ {
return NtUserSetForegroundWindow( hwnd, FALSE ); return NtUserSetForegroundWindow( hwnd );
} }
......
...@@ -5403,6 +5403,9 @@ ULONG_PTR WINAPI NtUserCallHwnd( HWND hwnd, DWORD code ) ...@@ -5403,6 +5403,9 @@ ULONG_PTR WINAPI NtUserCallHwnd( HWND hwnd, DWORD code )
case NtUserCallHwnd_IsWindowVisible: case NtUserCallHwnd_IsWindowVisible:
return is_window_visible( hwnd ); return is_window_visible( hwnd );
case NtUserCallHwnd_SetForegroundWindow:
return set_foreground_window( hwnd, FALSE );
default: default:
FIXME( "invalid code %u\n", code ); FIXME( "invalid code %u\n", code );
return 0; return 0;
...@@ -5489,9 +5492,6 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) ...@@ -5489,9 +5492,6 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code )
case NtUserCallHwndParam_ScreenToClient: case NtUserCallHwndParam_ScreenToClient:
return screen_to_client( hwnd, (POINT *)param ); return screen_to_client( hwnd, (POINT *)param );
case NtUserCallHwndParam_SetForegroundWindow:
return set_foreground_window( hwnd, param );
case NtUserCallHwndParam_SetWindowContextHelpId: case NtUserCallHwndParam_SetWindowContextHelpId:
return set_window_context_help_id( hwnd, param ); return set_window_context_help_id( hwnd, param );
......
...@@ -2350,7 +2350,7 @@ void macdrv_window_got_focus(HWND hwnd, const macdrv_event *event) ...@@ -2350,7 +2350,7 @@ void macdrv_window_got_focus(HWND hwnd, const macdrv_event *event)
if (ma != MA_NOACTIVATEANDEAT && ma != MA_NOACTIVATE) if (ma != MA_NOACTIVATEANDEAT && ma != MA_NOACTIVATE)
{ {
TRACE("setting foreground window to %p\n", hwnd); TRACE("setting foreground window to %p\n", hwnd);
NtUserSetForegroundWindow(hwnd, FALSE); NtUserSetForegroundWindow(hwnd);
return; return;
} }
} }
...@@ -2375,7 +2375,7 @@ void macdrv_window_lost_focus(HWND hwnd, const macdrv_event *event) ...@@ -2375,7 +2375,7 @@ void macdrv_window_lost_focus(HWND hwnd, const macdrv_event *event)
{ {
send_message(hwnd, WM_CANCELMODE, 0, 0); send_message(hwnd, WM_CANCELMODE, 0, 0);
if (hwnd == NtUserGetForegroundWindow()) if (hwnd == NtUserGetForegroundWindow())
NtUserSetForegroundWindow(NtUserGetDesktopWindow(), FALSE); NtUserSetForegroundWindow(NtUserGetDesktopWindow());
} }
} }
...@@ -2404,7 +2404,7 @@ void macdrv_app_deactivated(void) ...@@ -2404,7 +2404,7 @@ void macdrv_app_deactivated(void)
if (get_active_window() == NtUserGetForegroundWindow()) if (get_active_window() == NtUserGetForegroundWindow())
{ {
TRACE("setting fg to desktop\n"); 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) ...@@ -2573,7 +2573,7 @@ void macdrv_window_drag_begin(HWND hwnd, const macdrv_event *event)
if (ma != MA_NOACTIVATEANDEAT && ma != MA_NOACTIVATE) if (ma != MA_NOACTIVATEANDEAT && ma != MA_NOACTIVATE)
{ {
TRACE("setting foreground window to %p\n", hwnd); TRACE("setting foreground window to %p\n", hwnd);
NtUserSetForegroundWindow(hwnd, FALSE); NtUserSetForegroundWindow(hwnd);
} }
} }
......
...@@ -596,7 +596,7 @@ static void set_focus( Display *display, HWND hwnd, Time time ) ...@@ -596,7 +596,7 @@ static void set_focus( Display *display, HWND hwnd, Time time )
GUITHREADINFO threadinfo; GUITHREADINFO threadinfo;
TRACE( "setting foreground window to %p\n", hwnd ); TRACE( "setting foreground window to %p\n", hwnd );
NtUserSetForegroundWindow( hwnd, FALSE ); NtUserSetForegroundWindow( hwnd );
threadinfo.cbSize = sizeof(threadinfo); threadinfo.cbSize = sizeof(threadinfo);
NtUserGetGUIThreadInfo( 0, &threadinfo ); NtUserGetGUIThreadInfo( 0, &threadinfo );
...@@ -812,7 +812,7 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev ) ...@@ -812,7 +812,7 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev )
if (!hwnd) hwnd = x11drv_thread_data()->last_focus; if (!hwnd) hwnd = x11drv_thread_data()->last_focus;
if (hwnd && can_activate_window(hwnd)) set_focus( event->display, hwnd, CurrentTime ); if (hwnd && can_activate_window(hwnd)) set_focus( event->display, hwnd, CurrentTime );
} }
else NtUserSetForegroundWindow( hwnd, FALSE ); else NtUserSetForegroundWindow( hwnd );
return TRUE; return TRUE;
} }
...@@ -858,7 +858,7 @@ static void focus_out( Display *display , HWND hwnd ) ...@@ -858,7 +858,7 @@ static void focus_out( Display *display , HWND hwnd )
if (hwnd == NtUserGetForegroundWindow()) if (hwnd == NtUserGetForegroundWindow())
{ {
TRACE( "lost focus, setting fg to desktop\n" ); TRACE( "lost focus, setting fg to desktop\n" );
NtUserSetForegroundWindow( NtUserGetDesktopWindow(), FALSE ); NtUserSetForegroundWindow( NtUserGetDesktopWindow() );
} }
} }
} }
......
...@@ -983,6 +983,7 @@ enum ...@@ -983,6 +983,7 @@ enum
NtUserCallHwnd_IsWindowEnabled, NtUserCallHwnd_IsWindowEnabled,
NtUserCallHwnd_IsWindowUnicode, NtUserCallHwnd_IsWindowUnicode,
NtUserCallHwnd_IsWindowVisible, NtUserCallHwnd_IsWindowVisible,
NtUserCallHwnd_SetForegroundWindow,
}; };
static inline UINT NtUserArrangeIconicWindows( HWND parent ) static inline UINT NtUserArrangeIconicWindows( HWND parent )
...@@ -1041,6 +1042,11 @@ static inline BOOL NtUserIsWindowVisible( HWND hwnd ) ...@@ -1041,6 +1042,11 @@ static inline BOOL NtUserIsWindowVisible( HWND hwnd )
return NtUserCallHwnd( hwnd, NtUserCallHwnd_IsWindowVisible ); return NtUserCallHwnd( hwnd, NtUserCallHwnd_IsWindowVisible );
} }
static inline BOOL NtUserSetForegroundWindow( HWND hwnd )
{
return NtUserCallHwnd( hwnd, NtUserCallHwnd_SetForegroundWindow );
}
/* NtUserCallHwndParam codes, not compatible with Windows */ /* NtUserCallHwndParam codes, not compatible with Windows */
enum enum
{ {
...@@ -1067,7 +1073,6 @@ enum ...@@ -1067,7 +1073,6 @@ enum
NtUserCallHwndParam_MirrorRgn, NtUserCallHwndParam_MirrorRgn,
NtUserCallHwndParam_MonitorFromWindow, NtUserCallHwndParam_MonitorFromWindow,
NtUserCallHwndParam_ScreenToClient, NtUserCallHwndParam_ScreenToClient,
NtUserCallHwndParam_SetForegroundWindow,
NtUserCallHwndParam_SetWindowContextHelpId, NtUserCallHwndParam_SetWindowContextHelpId,
NtUserCallHwndParam_SetWindowPixelFormat, NtUserCallHwndParam_SetWindowPixelFormat,
NtUserCallHwndParam_ShowOwnedPopups, NtUserCallHwndParam_ShowOwnedPopups,
...@@ -1207,11 +1212,6 @@ static inline BOOL NtUserScreenToClient( HWND hwnd, POINT *pt ) ...@@ -1207,11 +1212,6 @@ static inline BOOL NtUserScreenToClient( HWND hwnd, POINT *pt )
return NtUserCallHwndParam( hwnd, (UINT_PTR)pt, NtUserCallHwndParam_ScreenToClient ); 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 ) static inline BOOL NtUserSetWindowContextHelpId( HWND hwnd, DWORD id )
{ {
return NtUserCallHwndParam( hwnd, id, NtUserCallHwndParam_SetWindowContextHelpId ); return NtUserCallHwndParam( hwnd, id, NtUserCallHwndParam_SetWindowContextHelpId );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment