Commit 1af4919a authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move GetClipCursor implementation from user32.

parent 91c095cd
......@@ -1947,32 +1947,7 @@ HCURSOR WINAPI DECLSPEC_HOTPATCH SetCursor( HCURSOR hCursor /* [in] Handle of cu
*/
BOOL WINAPI DECLSPEC_HOTPATCH GetClipCursor( RECT *rect )
{
DPI_AWARENESS_CONTEXT context;
UINT dpi;
BOOL ret;
if (!rect) return FALSE;
SERVER_START_REQ( set_cursor )
{
req->flags = 0;
if ((ret = !wine_server_call( req )))
{
rect->left = reply->new_clip.left;
rect->top = reply->new_clip.top;
rect->right = reply->new_clip.right;
rect->bottom = reply->new_clip.bottom;
}
}
SERVER_END_REQ;
if (ret && (dpi = get_thread_dpi()))
{
context = SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
*rect = map_dpi_rect( *rect, get_monitor_dpi( MonitorFromRect( rect, MONITOR_DEFAULTTOPRIMARY )), dpi );
SetThreadDpiAwarenessContext( context );
}
return ret;
return NtUserCallOneParam( (UINT_PTR)rect, NtUserGetClipCursor );
}
......
......@@ -127,3 +127,31 @@ BOOL WINAPI NtUserClipCursor( const RECT *rect )
if (ret) user_driver->pClipCursor( &new_rect );
return ret;
}
BOOL get_clip_cursor( RECT *rect )
{
UINT dpi;
BOOL ret;
if (!rect) return FALSE;
SERVER_START_REQ( set_cursor )
{
req->flags = 0;
if ((ret = !wine_server_call( req )))
{
rect->left = reply->new_clip.left;
rect->top = reply->new_clip.top;
rect->right = reply->new_clip.right;
rect->bottom = reply->new_clip.bottom;
}
}
SERVER_END_REQ;
if (ret && (dpi = get_thread_dpi()))
{
HMONITOR monitor = monitor_from_rect( rect, MONITOR_DEFAULTTOPRIMARY, 0 );
*rect = map_dpi_rect( *rect, get_monitor_dpi( monitor ), dpi );
}
return ret;
}
......@@ -4462,6 +4462,8 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code )
{
switch(code)
{
case NtUserGetClipCursor:
return get_clip_cursor( (RECT *)arg );
case NtUserGetSysColor:
return get_sys_color( arg );
case NtUserRealizePalette:
......
......@@ -241,6 +241,10 @@ struct unix_funcs
struct window_surface *surface );
};
/* cursoricon.c */
extern BOOL get_clip_cursor( RECT *rect ) DECLSPEC_HIDDEN;
/* sysparams.c */
extern RECT get_display_rect( const WCHAR *display ) DECLSPEC_HIDDEN;
extern UINT get_monitor_dpi( HMONITOR monitor ) DECLSPEC_HIDDEN;
extern UINT get_system_dpi(void) DECLSPEC_HIDDEN;
......
......@@ -52,6 +52,7 @@ struct enum_display_monitor_params
/* NtUserCallOneParam codes, not compatible with Windows */
enum
{
NtUserGetClipCursor,
NtUserGetSysColor,
NtUserGetSysColorBrush,
NtUserGetSysColorPen,
......
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