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
4e129f88
Commit
4e129f88
authored
Mar 12, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add a helper function to set the capture window.
parent
f6603d9f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
55 deletions
+41
-55
input.c
dlls/user32/input.c
+35
-27
menu.c
dlls/user32/menu.c
+5
-28
user_private.h
dlls/user32/user_private.h
+1
-0
No files found.
dlls/user32/input.c
View file @
4e129f88
...
...
@@ -76,6 +76,38 @@ static WORD get_key_state(void)
}
/**********************************************************************
* set_capture_window
*/
BOOL
set_capture_window
(
HWND
hwnd
,
UINT
gui_flags
,
HWND
*
prev_ret
)
{
HWND
previous
=
0
;
UINT
flags
=
0
;
BOOL
ret
;
if
(
gui_flags
&
GUI_INMENUMODE
)
flags
|=
CAPTURE_MENU
;
if
(
gui_flags
&
GUI_INMOVESIZE
)
flags
|=
CAPTURE_MOVESIZE
;
SERVER_START_REQ
(
set_capture_window
)
{
req
->
handle
=
hwnd
;
req
->
flags
=
flags
;
if
((
ret
=
!
wine_server_call_err
(
req
)))
{
previous
=
reply
->
previous
;
hwnd
=
reply
->
full_handle
;
}
}
SERVER_END_REQ
;
if
(
previous
&&
previous
!=
hwnd
)
SendMessageW
(
previous
,
WM_CAPTURECHANGED
,
0
,
(
LPARAM
)
hwnd
);
if
(
prev_ret
)
*
prev_ret
=
previous
;
return
ret
;
}
/***********************************************************************
* SendInput (USER32.@)
*/
...
...
@@ -191,22 +223,9 @@ BOOL WINAPI SetCursorPos( INT x, INT y )
*/
HWND
WINAPI
SetCapture
(
HWND
hwnd
)
{
HWND
previous
=
0
;
SERVER_START_REQ
(
set_capture_window
)
{
req
->
handle
=
hwnd
;
req
->
flags
=
0
;
if
(
!
wine_server_call_err
(
req
))
{
previous
=
reply
->
previous
;
hwnd
=
reply
->
full_handle
;
}
}
SERVER_END_REQ
;
HWND
previous
;
if
(
previous
&&
previous
!=
hwnd
)
SendMessageW
(
previous
,
WM_CAPTURECHANGED
,
0
,
(
LPARAM
)
hwnd
);
set_capture_window
(
hwnd
,
0
,
&
previous
);
return
previous
;
}
...
...
@@ -216,18 +235,7 @@ HWND WINAPI SetCapture( HWND hwnd )
*/
BOOL
WINAPI
ReleaseCapture
(
void
)
{
BOOL
ret
;
HWND
previous
=
0
;
SERVER_START_REQ
(
set_capture_window
)
{
req
->
handle
=
0
;
req
->
flags
=
0
;
if
((
ret
=
!
wine_server_call_err
(
req
)))
previous
=
reply
->
previous
;
}
SERVER_END_REQ
;
if
(
previous
)
SendMessageW
(
previous
,
WM_CAPTURECHANGED
,
0
,
0
);
BOOL
ret
=
set_capture_window
(
0
,
0
,
NULL
);
/* Somebody may have missed some mouse movements */
mouse_event
(
MOUSEEVENTF_MOVE
,
0
,
0
,
0
,
0
);
...
...
dlls/user32/menu.c
View file @
4e129f88
...
...
@@ -2636,30 +2636,6 @@ static BOOL MENU_MouseMove( MTRACKER* pmt, HMENU hPtMenu, UINT wFlags )
/***********************************************************************
* MENU_SetCapture
*/
static
void
MENU_SetCapture
(
HWND
hwnd
)
{
HWND
previous
=
0
;
SERVER_START_REQ
(
set_capture_window
)
{
req
->
handle
=
hwnd
;
req
->
flags
=
CAPTURE_MENU
;
if
(
!
wine_server_call_err
(
req
))
{
previous
=
reply
->
previous
;
hwnd
=
reply
->
full_handle
;
}
}
SERVER_END_REQ
;
if
(
previous
&&
previous
!=
hwnd
)
SendMessageW
(
previous
,
WM_CAPTURECHANGED
,
0
,
(
LPARAM
)
hwnd
);
}
/***********************************************************************
* MENU_DoNextMenu
*
* NOTE: WM_NEXTMENU documented in Win32 is a bit different.
...
...
@@ -2781,7 +2757,7 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT vk )
if
(
hNewWnd
!=
pmt
->
hOwnerWnd
)
{
pmt
->
hOwnerWnd
=
hNewWnd
;
MENU_SetCapture
(
pmt
->
hOwnerWnd
);
set_capture_window
(
pmt
->
hOwnerWnd
,
GUI_INMENUMODE
,
NULL
);
}
pmt
->
hTopMenu
=
pmt
->
hCurrentMenu
=
hNewMenu
;
/* all subpopups are hidden */
...
...
@@ -3015,7 +2991,7 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
if
(
wFlags
&
TF_ENDMENU
)
fEndMenu
=
TRUE
;
MENU_SetCapture
(
mt
.
hOwnerWnd
);
set_capture_window
(
mt
.
hOwnerWnd
,
GUI_INMENUMODE
,
NULL
);
while
(
!
fEndMenu
)
{
...
...
@@ -3239,7 +3215,7 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
else
mt
.
trackFlags
&=
~
TF_SKIPREMOVE
;
}
MENU_SetCapture
(
0
);
/* release the capture */
set_capture_window
(
0
,
GUI_INMENUMODE
,
NULL
);
/* If dropdown is still painted and the close box is clicked on
then the menu will be destroyed as part of the DispatchMessage above.
...
...
@@ -4122,7 +4098,8 @@ BOOL MENU_SetMenu( HWND hWnd, HMENU hMenu )
return
FALSE
;
hWnd
=
WIN_GetFullHandle
(
hWnd
);
if
(
GetCapture
()
==
hWnd
)
MENU_SetCapture
(
0
);
/* release the capture */
if
(
GetCapture
()
==
hWnd
)
set_capture_window
(
0
,
GUI_INMENUMODE
,
NULL
);
/* release the capture */
if
(
hMenu
!=
0
)
{
...
...
dlls/user32/user_private.h
View file @
4e129f88
...
...
@@ -234,6 +234,7 @@ struct dce;
extern
BOOL
CLIPBOARD_ReleaseOwner
(
void
)
DECLSPEC_HIDDEN
;
extern
BOOL
FOCUS_MouseActivate
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
BOOL
HOOK_IsHooked
(
INT
id
)
DECLSPEC_HIDDEN
;
extern
BOOL
set_capture_window
(
HWND
hwnd
,
UINT
gui_flags
,
HWND
*
prev_ret
);
extern
void
free_dce
(
struct
dce
*
dce
,
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
void
invalidate_dce
(
HWND
hwnd
,
const
RECT
*
rect
)
DECLSPEC_HIDDEN
;
extern
void
erase_now
(
HWND
hwnd
,
UINT
rdw_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