Commit b7570b79 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

win32u: Add a reset parameter to WM_WINE_CLIPCURSOR and driver ClipCursor.

parent b16ab961
......@@ -752,7 +752,7 @@ static BOOL nulldrv_SetCursorPos( INT x, INT y )
return TRUE;
}
static BOOL nulldrv_ClipCursor( LPCRECT clip )
static BOOL nulldrv_ClipCursor( const RECT *clip, BOOL reset )
{
return TRUE;
}
......@@ -1133,9 +1133,9 @@ static BOOL loaderdrv_SetCursorPos( INT x, INT y )
return load_driver()->pSetCursorPos( x, y );
}
static BOOL loaderdrv_ClipCursor( const RECT *clip )
static BOOL loaderdrv_ClipCursor( const RECT *clip, BOOL reset )
{
return load_driver()->pClipCursor( clip );
return load_driver()->pClipCursor( clip, reset );
}
static LRESULT nulldrv_ClipboardWindowProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
......
......@@ -2497,16 +2497,16 @@ BOOL get_clip_cursor( RECT *rect )
return ret;
}
BOOL process_wine_clipcursor( BOOL empty )
BOOL process_wine_clipcursor( BOOL empty, BOOL reset )
{
RECT rect;
TRACE( "empty %u\n", empty );
TRACE( "empty %u, reset %u\n", empty, reset );
if (empty) return user_driver->pClipCursor( NULL );
if (empty || reset) return user_driver->pClipCursor( NULL, reset );
get_clip_cursor( &rect );
return user_driver->pClipCursor( &rect );
return user_driver->pClipCursor( &rect, FALSE );
}
/***********************************************************************
......@@ -2552,6 +2552,6 @@ BOOL WINAPI NtUserClipCursor( const RECT *rect )
}
}
SERVER_END_REQ;
if (ret) user_driver->pClipCursor( &new_rect );
if (ret) user_driver->pClipCursor( &new_rect, FALSE );
return ret;
}
......@@ -1272,7 +1272,7 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR
return call_current_hook( h_extra->handle, HC_ACTION, wparam, h_extra->lparam );
}
case WM_WINE_CLIPCURSOR:
return process_wine_clipcursor( wparam );
return process_wine_clipcursor( wparam, lparam );
case WM_WINE_UPDATEWINDOWSTATE:
update_window_state( hwnd );
return 0;
......
......@@ -101,7 +101,7 @@ extern BOOL set_foreground_window( HWND hwnd, BOOL mouse ) DECLSPEC_HIDDEN;
extern void toggle_caret( HWND hwnd ) DECLSPEC_HIDDEN;
extern void update_mouse_tracking_info( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL get_clip_cursor( RECT *rect ) DECLSPEC_HIDDEN;
extern BOOL process_wine_clipcursor( BOOL empty ) DECLSPEC_HIDDEN;
extern BOOL process_wine_clipcursor( BOOL empty, BOOL reset ) DECLSPEC_HIDDEN;
/* menu.c */
extern HMENU create_menu( BOOL is_popup ) DECLSPEC_HIDDEN;
......
......@@ -133,7 +133,7 @@ extern BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device
BOOL force, void *param ) DECLSPEC_HIDDEN;
extern BOOL macdrv_GetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp) DECLSPEC_HIDDEN;
extern BOOL macdrv_SetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp) DECLSPEC_HIDDEN;
extern BOOL macdrv_ClipCursor(LPCRECT clip) DECLSPEC_HIDDEN;
extern BOOL macdrv_ClipCursor(const RECT *clip, BOOL reset) DECLSPEC_HIDDEN;
extern LRESULT macdrv_DesktopWindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) DECLSPEC_HIDDEN;
extern void macdrv_DestroyWindow(HWND hwnd) DECLSPEC_HIDDEN;
extern void macdrv_SetDesktopWindow(HWND hwnd) DECLSPEC_HIDDEN;
......@@ -157,7 +157,6 @@ extern void macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, UINT swp_flags
const RECT *visible_rect, const RECT *valid_rects,
struct window_surface *surface) DECLSPEC_HIDDEN;
extern void macdrv_DestroyCursorIcon(HCURSOR cursor) DECLSPEC_HIDDEN;
extern BOOL macdrv_ClipCursor(LPCRECT clip) DECLSPEC_HIDDEN;
extern BOOL macdrv_GetCursorPos(LPPOINT pos) DECLSPEC_HIDDEN;
extern void macdrv_SetCapture(HWND hwnd, UINT flags) DECLSPEC_HIDDEN;
extern void macdrv_SetCursor(HCURSOR cursor) DECLSPEC_HIDDEN;
......
......@@ -659,11 +659,13 @@ void macdrv_DestroyCursorIcon(HCURSOR cursor)
*
* Set the cursor clipping rectangle.
*/
BOOL macdrv_ClipCursor(LPCRECT clip)
BOOL macdrv_ClipCursor(const RECT *clip, BOOL reset)
{
CGRect rect;
TRACE("%s\n", wine_dbgstr_rect(clip));
TRACE("%s %u\n", wine_dbgstr_rect(clip), reset);
if (reset) return TRUE;
if (clip)
{
......
......@@ -1557,17 +1557,18 @@ BOOL X11DRV_GetCursorPos(LPPOINT pos)
/***********************************************************************
* ClipCursor (X11DRV.@)
*/
BOOL X11DRV_ClipCursor( LPCRECT clip )
BOOL X11DRV_ClipCursor( const RECT *clip, BOOL reset )
{
RECT virtual_rect = NtUserGetVirtualScreenRect();
TRACE( "clip %p, reset %u\n", clip, reset );
if (!clip) clip = &virtual_rect;
if (grab_pointer)
if (!reset && grab_pointer)
{
RECT virtual_rect = NtUserGetVirtualScreenRect();
HWND foreground = NtUserGetForegroundWindow();
DWORD tid, pid;
if (!clip) clip = &virtual_rect;
/* forward request to the foreground window if it's in a different thread */
tid = NtUserGetWindowThread( foreground, &pid );
if (tid && tid != GetCurrentThreadId() && pid == GetCurrentProcessId())
......@@ -1615,7 +1616,7 @@ LRESULT clip_cursor_request( HWND hwnd, BOOL fullscreen, BOOL reset )
else
{
NtUserGetClipCursor( &clip );
X11DRV_ClipCursor( &clip );
X11DRV_ClipCursor( &clip, FALSE );
}
return 0;
......
......@@ -216,7 +216,7 @@ extern void X11DRV_DestroyCursorIcon( HCURSOR handle ) DECLSPEC_HIDDEN;
extern void X11DRV_SetCursor( HCURSOR handle ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_SetCursorPos( INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_GetCursorPos( LPPOINT pos ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_ClipCursor( LPCRECT clip ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_ClipCursor( const RECT *clip, BOOL reset ) DECLSPEC_HIDDEN;
extern LONG X11DRV_ChangeDisplaySettings( LPDEVMODEW displays, LPCWSTR primary_name, HWND hwnd, DWORD flags, LPVOID lpvoid ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_GetCurrentDisplaySettings( LPCWSTR name, BOOL is_primary, LPDEVMODEW devmode ) DECLSPEC_HIDDEN;
extern INT X11DRV_GetDisplayDepth( LPCWSTR name, BOOL is_primary ) DECLSPEC_HIDDEN;
......
......@@ -301,7 +301,7 @@ struct user_driver_funcs
void (*pSetCursor)(HCURSOR);
BOOL (*pGetCursorPos)(LPPOINT);
BOOL (*pSetCursorPos)(INT,INT);
BOOL (*pClipCursor)(LPCRECT);
BOOL (*pClipCursor)(const RECT*,BOOL);
/* clipboard functions */
LRESULT (*pClipboardWindowProc)(HWND,UINT,WPARAM,LPARAM);
void (*pUpdateClipboard)(void);
......
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