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
33c491eb
Commit
33c491eb
authored
Apr 22, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Allow changing the clipping rectangle while the mouse is grabbed.
parent
a292220e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
mouse.c
dlls/winex11.drv/mouse.c
+15
-6
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-0
No files found.
dlls/winex11.drv/mouse.c
View file @
33c491eb
...
...
@@ -376,6 +376,8 @@ static HWND create_clipping_msg_window(void)
*/
LRESULT
clip_cursor_notify
(
HWND
hwnd
,
HWND
new_clip_hwnd
)
{
struct
x11drv_thread_data
*
data
=
x11drv_thread_data
();
if
(
hwnd
==
GetDesktopWindow
())
/* change the clip window stored in the desktop process */
{
static
HWND
clip_hwnd
;
...
...
@@ -385,8 +387,9 @@ LRESULT clip_cursor_notify( HWND hwnd, HWND new_clip_hwnd )
if
(
prev
||
new_clip_hwnd
)
TRACE
(
"clip hwnd changed from %p to %p
\n
"
,
prev
,
new_clip_hwnd
);
if
(
prev
)
SendNotifyMessageW
(
prev
,
WM_X11DRV_CLIP_CURSOR
,
0
,
0
);
}
else
/* this is a notification that clipping has been reset */
else
if
(
hwnd
==
data
->
clip_hwnd
)
/* this is a notification that clipping has been reset */
{
data
->
clip_hwnd
=
0
;
disable_xinput2
();
DestroyWindow
(
hwnd
);
}
...
...
@@ -402,19 +405,21 @@ static BOOL grab_clipping_window( const RECT *clip )
{
struct
x11drv_thread_data
*
data
=
x11drv_init_thread_data
();
Window
clip_window
=
init_clip_window
();
HWND
msg_hwnd
;
HWND
msg_hwnd
=
0
;
if
(
!
clip_window
)
return
TRUE
;
if
(
!
(
msg_hwnd
=
create_clipping_msg_window
()))
return
TRUE
;
/* create a clip message window unless we are already clipping */
if
(
!
data
->
clip_hwnd
&&
!
(
msg_hwnd
=
create_clipping_msg_window
()))
return
TRUE
;
TRACE
(
"clipping to %s
\n
"
,
wine_dbgstr_rect
(
clip
)
);
wine_tsx11_lock
();
XUnmapWindow
(
data
->
display
,
clip_window
);
if
(
msg_hwnd
)
XUnmapWindow
(
data
->
display
,
clip_window
);
XMoveResizeWindow
(
data
->
display
,
clip_window
,
clip
->
left
-
virtual_screen_rect
.
left
,
clip
->
top
-
virtual_screen_rect
.
top
,
clip
->
right
-
clip
->
left
,
clip
->
bottom
-
clip
->
top
);
XMapWindow
(
data
->
display
,
clip_window
);
if
(
msg_hwnd
)
XMapWindow
(
data
->
display
,
clip_window
);
if
(
!
XGrabPointer
(
data
->
display
,
clip_window
,
False
,
PointerMotionMask
|
ButtonPressMask
|
ButtonReleaseMask
,
GrabModeAsync
,
GrabModeAsync
,
clip_window
,
None
,
CurrentTime
))
...
...
@@ -423,13 +428,17 @@ static BOOL grab_clipping_window( const RECT *clip )
if
(
!
clipping_cursor
)
{
DestroyWindow
(
msg_hwnd
);
if
(
msg_hwnd
)
DestroyWindow
(
msg_hwnd
);
return
FALSE
;
}
if
(
msg_hwnd
)
{
data
->
clip_hwnd
=
msg_hwnd
;
enable_xinput2
();
sync_window_cursor
(
clip_window
);
clip_rect
=
*
clip
;
SendMessageW
(
GetDesktopWindow
(),
WM_X11DRV_CLIP_CURSOR
,
0
,
(
LPARAM
)
msg_hwnd
);
}
return
TRUE
;
}
...
...
dlls/winex11.drv/x11drv.h
View file @
33c491eb
...
...
@@ -551,6 +551,7 @@ struct x11drv_thread_data
XFontSet
font_set
;
/* international text drawing font set */
Window
selection_wnd
;
/* window used for selection interactions */
Window
clip_window
;
/* window used for cursor clipping */
HWND
clip_hwnd
;
/* message window stored in desktop while clipping is active */
HKL
kbd_layout
;
/* active keyboard layout */
enum
{
xi_unavailable
=
-
1
,
xi_unknown
,
xi_disabled
,
xi_enabled
}
xi2_state
;
/* XInput2 state */
};
...
...
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