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 @@
*/
BOOL WINAPI SetForegroundWindow( HWND hwnd )
{
return NtUserSetForegroundWindow( hwnd, FALSE );
return NtUserSetForegroundWindow( hwnd );
}
......
......@@ -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 );
......
......@@ -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);
}
}
......
......@@ -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() );
}
}
}
......
......@@ -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 );
......
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