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
abfed909
Commit
abfed909
authored
Feb 01, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Move the window resizing support to mouse.c.
parent
002f85a2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
28 deletions
+45
-28
mouse.c
dlls/winex11.drv/mouse.c
+42
-0
window.c
dlls/winex11.drv/window.c
+2
-28
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-0
No files found.
dlls/winex11.drv/mouse.c
View file @
abfed909
...
...
@@ -1327,6 +1327,48 @@ BOOL CDECL X11DRV_ClipCursor( LPCRECT clip )
}
/***********************************************************************
* move_resize_window
*/
void
move_resize_window
(
Display
*
display
,
struct
x11drv_win_data
*
data
,
int
dir
)
{
DWORD
pt
;
int
x
,
y
,
button
=
0
;
XEvent
xev
;
pt
=
GetMessagePos
();
x
=
(
short
)
LOWORD
(
pt
);
y
=
(
short
)
HIWORD
(
pt
);
if
(
GetKeyState
(
VK_LBUTTON
)
&
0x8000
)
button
=
1
;
else
if
(
GetKeyState
(
VK_MBUTTON
)
&
0x8000
)
button
=
2
;
else
if
(
GetKeyState
(
VK_RBUTTON
)
&
0x8000
)
button
=
3
;
TRACE
(
"hwnd %p/%lx, x %d, y %d, dir %d, button %d
\n
"
,
data
->
hwnd
,
data
->
whole_window
,
x
,
y
,
dir
,
button
);
xev
.
xclient
.
type
=
ClientMessage
;
xev
.
xclient
.
window
=
data
->
whole_window
;
xev
.
xclient
.
message_type
=
x11drv_atom
(
_NET_WM_MOVERESIZE
);
xev
.
xclient
.
serial
=
0
;
xev
.
xclient
.
display
=
display
;
xev
.
xclient
.
send_event
=
True
;
xev
.
xclient
.
format
=
32
;
xev
.
xclient
.
data
.
l
[
0
]
=
x
-
virtual_screen_rect
.
left
;
/* x coord */
xev
.
xclient
.
data
.
l
[
1
]
=
y
-
virtual_screen_rect
.
top
;
/* y coord */
xev
.
xclient
.
data
.
l
[
2
]
=
dir
;
/* direction */
xev
.
xclient
.
data
.
l
[
3
]
=
button
;
/* button */
xev
.
xclient
.
data
.
l
[
4
]
=
0
;
/* unused */
/* need to ungrab the pointer that may have been automatically grabbed
* with a ButtonPress event */
wine_tsx11_lock
();
XUngrabPointer
(
display
,
CurrentTime
);
XSendEvent
(
display
,
root_window
,
False
,
SubstructureNotifyMask
|
SubstructureRedirectMask
,
&
xev
);
wine_tsx11_unlock
();
}
/***********************************************************************
* X11DRV_ButtonPress
*/
void
X11DRV_ButtonPress
(
HWND
hwnd
,
XEvent
*
xev
)
...
...
dlls/winex11.drv/window.c
View file @
abfed909
...
...
@@ -2779,9 +2779,7 @@ static BOOL is_netwm_supported( Display *display, Atom atom )
LRESULT
CDECL
X11DRV_SysCommand
(
HWND
hwnd
,
WPARAM
wparam
,
LPARAM
lparam
)
{
WPARAM
hittest
=
wparam
&
0x0f
;
DWORD
dwPoint
;
int
x
,
y
,
dir
;
XEvent
xev
;
int
dir
;
Display
*
display
=
thread_display
();
struct
x11drv_win_data
*
data
;
...
...
@@ -2833,30 +2831,6 @@ LRESULT CDECL X11DRV_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam )
return
-
1
;
}
dwPoint
=
GetMessagePos
();
x
=
(
short
)
LOWORD
(
dwPoint
);
y
=
(
short
)
HIWORD
(
dwPoint
);
TRACE
(
"hwnd %p, x %d, y %d, dir %d
\n
"
,
hwnd
,
x
,
y
,
dir
);
xev
.
xclient
.
type
=
ClientMessage
;
xev
.
xclient
.
window
=
X11DRV_get_whole_window
(
hwnd
);
xev
.
xclient
.
message_type
=
x11drv_atom
(
_NET_WM_MOVERESIZE
);
xev
.
xclient
.
serial
=
0
;
xev
.
xclient
.
display
=
display
;
xev
.
xclient
.
send_event
=
True
;
xev
.
xclient
.
format
=
32
;
xev
.
xclient
.
data
.
l
[
0
]
=
x
-
virtual_screen_rect
.
left
;
/* x coord */
xev
.
xclient
.
data
.
l
[
1
]
=
y
-
virtual_screen_rect
.
top
;
/* y coord */
xev
.
xclient
.
data
.
l
[
2
]
=
dir
;
/* direction */
xev
.
xclient
.
data
.
l
[
3
]
=
1
;
/* button */
xev
.
xclient
.
data
.
l
[
4
]
=
0
;
/* unused */
/* need to ungrab the pointer that may have been automatically grabbed
* with a ButtonPress event */
wine_tsx11_lock
();
XUngrabPointer
(
display
,
CurrentTime
);
XSendEvent
(
display
,
root_window
,
False
,
SubstructureNotifyMask
|
SubstructureRedirectMask
,
&
xev
);
wine_tsx11_unlock
();
move_resize_window
(
display
,
data
,
dir
);
return
0
;
}
dlls/winex11.drv/x11drv.h
View file @
abfed909
...
...
@@ -674,6 +674,7 @@ extern LRESULT clip_cursor_notify( HWND hwnd, HWND new_clip_hwnd ) DECLSPEC_HIDD
extern
void
ungrab_clipping_window
(
void
)
DECLSPEC_HIDDEN
;
extern
void
reset_clipping_window
(
void
)
DECLSPEC_HIDDEN
;
extern
BOOL
clip_fullscreen_window
(
HWND
hwnd
,
BOOL
reset
)
DECLSPEC_HIDDEN
;
extern
void
move_resize_window
(
Display
*
display
,
struct
x11drv_win_data
*
data
,
int
dir
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_InitKeyboard
(
Display
*
display
)
DECLSPEC_HIDDEN
;
extern
DWORD
CDECL
X11DRV_MsgWaitForMultipleObjectsEx
(
DWORD
count
,
const
HANDLE
*
handles
,
DWORD
timeout
,
DWORD
mask
,
DWORD
flags
)
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