Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1cea2be9
Commit
1cea2be9
authored
May 26, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
May 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move cursor clipping functions to input.c.
parent
c22c10d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
76 deletions
+76
-76
cursoricon.c
dlls/win32u/cursoricon.c
+0
-75
input.c
dlls/win32u/input.c
+75
-0
win32u_private.h
dlls/win32u/win32u_private.h
+1
-1
No files found.
dlls/win32u/cursoricon.c
View file @
1cea2be9
...
...
@@ -150,81 +150,6 @@ HCURSOR WINAPI NtUserGetCursor(void)
return
ret
;
}
/***********************************************************************
* NtUserClipCursor (win32u.@)
*/
BOOL
WINAPI
NtUserClipCursor
(
const
RECT
*
rect
)
{
UINT
dpi
;
BOOL
ret
;
RECT
new_rect
;
TRACE
(
"Clipping to %s
\n
"
,
wine_dbgstr_rect
(
rect
)
);
if
(
rect
)
{
if
(
rect
->
left
>
rect
->
right
||
rect
->
top
>
rect
->
bottom
)
return
FALSE
;
if
((
dpi
=
get_thread_dpi
()))
{
HMONITOR
monitor
=
monitor_from_rect
(
rect
,
MONITOR_DEFAULTTOPRIMARY
,
dpi
);
new_rect
=
map_dpi_rect
(
*
rect
,
dpi
,
get_monitor_dpi
(
monitor
));
rect
=
&
new_rect
;
}
}
SERVER_START_REQ
(
set_cursor
)
{
if
(
rect
)
{
req
->
flags
=
SET_CURSOR_CLIP
;
req
->
clip
.
left
=
rect
->
left
;
req
->
clip
.
top
=
rect
->
top
;
req
->
clip
.
right
=
rect
->
right
;
req
->
clip
.
bottom
=
rect
->
bottom
;
}
else
req
->
flags
=
SET_CURSOR_NOCLIP
;
if
((
ret
=
!
wine_server_call
(
req
)))
{
new_rect
.
left
=
reply
->
new_clip
.
left
;
new_rect
.
top
=
reply
->
new_clip
.
top
;
new_rect
.
right
=
reply
->
new_clip
.
right
;
new_rect
.
bottom
=
reply
->
new_clip
.
bottom
;
}
}
SERVER_END_REQ
;
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
;
}
HICON
alloc_cursoricon_handle
(
BOOL
is_icon
)
{
struct
cursoricon_object
*
obj
;
...
...
dlls/win32u/input.c
View file @
1cea2be9
...
...
@@ -2468,3 +2468,78 @@ BOOL WINAPI NtUserGetPointerInfoList( UINT32 id, POINTER_INPUT_TYPE type, UINT_P
RtlSetLastWin32Error
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
}
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
;
}
/***********************************************************************
* NtUserClipCursor (win32u.@)
*/
BOOL
WINAPI
NtUserClipCursor
(
const
RECT
*
rect
)
{
UINT
dpi
;
BOOL
ret
;
RECT
new_rect
;
TRACE
(
"Clipping to %s
\n
"
,
wine_dbgstr_rect
(
rect
)
);
if
(
rect
)
{
if
(
rect
->
left
>
rect
->
right
||
rect
->
top
>
rect
->
bottom
)
return
FALSE
;
if
((
dpi
=
get_thread_dpi
()))
{
HMONITOR
monitor
=
monitor_from_rect
(
rect
,
MONITOR_DEFAULTTOPRIMARY
,
dpi
);
new_rect
=
map_dpi_rect
(
*
rect
,
dpi
,
get_monitor_dpi
(
monitor
));
rect
=
&
new_rect
;
}
}
SERVER_START_REQ
(
set_cursor
)
{
if
(
rect
)
{
req
->
flags
=
SET_CURSOR_CLIP
;
req
->
clip
.
left
=
rect
->
left
;
req
->
clip
.
top
=
rect
->
top
;
req
->
clip
.
right
=
rect
->
right
;
req
->
clip
.
bottom
=
rect
->
bottom
;
}
else
req
->
flags
=
SET_CURSOR_NOCLIP
;
if
((
ret
=
!
wine_server_call
(
req
)))
{
new_rect
.
left
=
reply
->
new_clip
.
left
;
new_rect
.
top
=
reply
->
new_clip
.
top
;
new_rect
.
right
=
reply
->
new_clip
.
right
;
new_rect
.
bottom
=
reply
->
new_clip
.
bottom
;
}
}
SERVER_END_REQ
;
if
(
ret
)
user_driver
->
pClipCursor
(
&
new_rect
);
return
ret
;
}
dlls/win32u/win32u_private.h
View file @
1cea2be9
...
...
@@ -39,7 +39,6 @@ extern void release_clipboard_owner( HWND hwnd ) DECLSPEC_HIDDEN;
/* cursoricon.c */
extern
HICON
alloc_cursoricon_handle
(
BOOL
is_icon
)
DECLSPEC_HIDDEN
;
extern
BOOL
get_clip_cursor
(
RECT
*
rect
)
DECLSPEC_HIDDEN
;
extern
ULONG_PTR
get_icon_param
(
HICON
handle
)
DECLSPEC_HIDDEN
;
extern
ULONG_PTR
set_icon_param
(
HICON
handle
,
ULONG_PTR
param
)
DECLSPEC_HIDDEN
;
...
...
@@ -101,6 +100,7 @@ extern BOOL set_caret_pos( int x, int y ) DECLSPEC_HIDDEN;
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
;
/* menu.c */
extern
HMENU
create_menu
(
BOOL
is_popup
)
DECLSPEC_HIDDEN
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment