Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2d1396af
Commit
2d1396af
authored
Dec 29, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Dec 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Extract some duplicated code to a new perform_window_command() function.
This also changes to posting rather than sending WM_SYSCOMMAND/SC_MINIMIZE.
parent
2c6ad182
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
68 deletions
+61
-68
event.c
dlls/winemac.drv/event.c
+1
-1
window.c
dlls/winemac.drv/window.c
+60
-67
No files found.
dlls/winemac.drv/event.c
View file @
2d1396af
...
...
@@ -104,7 +104,6 @@ static macdrv_event_mask get_event_mask(DWORD mask)
event_mask
|=
event_mask_for_type
(
IM_SET_TEXT
);
event_mask
|=
event_mask_for_type
(
STATUS_ITEM_MOUSE_BUTTON
);
event_mask
|=
event_mask_for_type
(
STATUS_ITEM_MOUSE_MOVE
);
event_mask
|=
event_mask_for_type
(
WINDOW_CLOSE_REQUESTED
);
event_mask
|=
event_mask_for_type
(
WINDOW_DID_UNMINIMIZE
);
event_mask
|=
event_mask_for_type
(
WINDOW_FRAME_CHANGED
);
event_mask
|=
event_mask_for_type
(
WINDOW_GOT_FOCUS
);
...
...
@@ -116,6 +115,7 @@ static macdrv_event_mask get_event_mask(DWORD mask)
event_mask
|=
event_mask_for_type
(
QUERY_EVENT
);
event_mask
|=
event_mask_for_type
(
RELEASE_CAPTURE
);
event_mask
|=
event_mask_for_type
(
WINDOW_BROUGHT_FORWARD
);
event_mask
|=
event_mask_for_type
(
WINDOW_CLOSE_REQUESTED
);
event_mask
|=
event_mask_for_type
(
WINDOW_DRAG_BEGIN
);
event_mask
|=
event_mask_for_type
(
WINDOW_DRAG_END
);
event_mask
|=
event_mask_for_type
(
WINDOW_MINIMIZE_REQUESTED
);
...
...
dlls/winemac.drv/window.c
View file @
2d1396af
...
...
@@ -1164,6 +1164,50 @@ static LRESULT move_window(HWND hwnd, WPARAM wparam)
}
/***********************************************************************
* perform_window_command
*/
static
void
perform_window_command
(
HWND
hwnd
,
DWORD
style_any
,
DWORD
style_none
,
WORD
command
,
WORD
hittest
)
{
DWORD
style
;
TRACE
(
"win %p style_any 0x%08x style_none 0x%08x command 0x%04x hittest 0x%04x
\n
"
,
hwnd
,
style_any
,
style_none
,
command
,
hittest
);
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
if
((
style_any
&&
!
(
style
&
style_any
))
||
(
style
&
(
WS_DISABLED
|
style_none
)))
{
TRACE
(
"not changing win %p style 0x%08x
\n
"
,
hwnd
,
style
);
return
;
}
if
(
GetActiveWindow
()
!=
hwnd
)
{
LRESULT
ma
=
SendMessageW
(
hwnd
,
WM_MOUSEACTIVATE
,
(
WPARAM
)
GetAncestor
(
hwnd
,
GA_ROOT
),
MAKELPARAM
(
hittest
,
WM_NCLBUTTONDOWN
));
switch
(
ma
)
{
case
MA_NOACTIVATEANDEAT
:
case
MA_ACTIVATEANDEAT
:
TRACE
(
"not changing win %p mouse-activate result %ld
\n
"
,
hwnd
,
ma
);
return
;
case
MA_NOACTIVATE
:
break
;
case
MA_ACTIVATE
:
case
0
:
SetActiveWindow
(
hwnd
);
break
;
default:
WARN
(
"unknown WM_MOUSEACTIVATE code %ld
\n
"
,
ma
);
break
;
}
}
TRACE
(
"changing win %p
\n
"
,
hwnd
);
PostMessageW
(
hwnd
,
WM_SYSCOMMAND
,
command
,
0
);
}
/**********************************************************************
* CreateDesktopWindow (MACDRV.@)
*/
...
...
@@ -1850,45 +1894,26 @@ done:
*/
void
macdrv_window_close_requested
(
HWND
hwnd
)
{
/* Ignore the delete window request if the window has been disabled. This
* is to disallow applications from being closed while in a modal state.
*/
if
(
IsWindowEnabled
(
hwnd
))
HMENU
sysmenu
;
if
(
GetClassLongW
(
hwnd
,
GCL_STYLE
)
&
CS_NOCLOSE
)
{
HMENU
hSysMenu
;
TRACE
(
"not closing win %p class style CS_NOCLOSE
\n
"
,
hwnd
);
return
;
}
if
(
GetClassLongW
(
hwnd
,
GCL_STYLE
)
&
CS_NOCLOSE
)
return
;
hSysMenu
=
GetSystemMenu
(
hwnd
,
FALSE
);
if
(
hSysMenu
)
{
UINT
state
=
GetMenuState
(
hSysMenu
,
SC_CLOSE
,
MF_BYCOMMAND
);
if
(
state
==
0xFFFFFFFF
||
(
state
&
(
MF_DISABLED
|
MF_GRAYED
)))
return
;
}
if
(
GetActiveWindow
()
!=
hwnd
)
sysmenu
=
GetSystemMenu
(
hwnd
,
FALSE
);
if
(
sysmenu
)
{
UINT
state
=
GetMenuState
(
sysmenu
,
SC_CLOSE
,
MF_BYCOMMAND
);
if
(
state
==
0xFFFFFFFF
||
(
state
&
(
MF_DISABLED
|
MF_GRAYED
)))
{
LRESULT
ma
=
SendMessageW
(
hwnd
,
WM_MOUSEACTIVATE
,
(
WPARAM
)
GetAncestor
(
hwnd
,
GA_ROOT
),
MAKELPARAM
(
HTCLOSE
,
WM_NCLBUTTONDOWN
));
switch
(
ma
)
{
case
MA_NOACTIVATEANDEAT
:
case
MA_ACTIVATEANDEAT
:
return
;
case
MA_NOACTIVATE
:
break
;
case
MA_ACTIVATE
:
case
0
:
SetActiveWindow
(
hwnd
);
break
;
default:
WARN
(
"unknown WM_MOUSEACTIVATE code %d
\n
"
,
(
int
)
ma
);
break
;
}
TRACE
(
"not closing win %p menu state 0x%08x
\n
"
,
hwnd
,
state
);
return
;
}
PostMessageW
(
hwnd
,
WM_SYSCOMMAND
,
SC_CLOSE
,
0
);
}
perform_window_command
(
hwnd
,
0
,
0
,
SC_CLOSE
,
HTCLOSE
);
}
...
...
@@ -2036,39 +2061,7 @@ void macdrv_app_deactivated(void)
*/
void
macdrv_window_minimize_requested
(
HWND
hwnd
)
{
DWORD
style
;
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
if
(
!
(
style
&
WS_MINIMIZEBOX
)
||
(
style
&
(
WS_DISABLED
|
WS_MINIMIZE
)))
{
TRACE
(
"not minimizing win %p style 0x%08x
\n
"
,
hwnd
,
style
);
return
;
}
if
(
GetActiveWindow
()
!=
hwnd
)
{
LRESULT
ma
=
SendMessageW
(
hwnd
,
WM_MOUSEACTIVATE
,
(
WPARAM
)
GetAncestor
(
hwnd
,
GA_ROOT
),
MAKELPARAM
(
HTMINBUTTON
,
WM_NCLBUTTONDOWN
));
switch
(
ma
)
{
case
MA_NOACTIVATEANDEAT
:
case
MA_ACTIVATEANDEAT
:
TRACE
(
"not minimizing win %p mouse-activate result %ld
\n
"
,
hwnd
,
ma
);
return
;
case
MA_NOACTIVATE
:
break
;
case
MA_ACTIVATE
:
case
0
:
SetActiveWindow
(
hwnd
);
break
;
default:
WARN
(
"unknown WM_MOUSEACTIVATE code %ld
\n
"
,
ma
);
break
;
}
}
TRACE
(
"minimizing win %p
\n
"
,
hwnd
);
SendMessageW
(
hwnd
,
WM_SYSCOMMAND
,
SC_MINIMIZE
,
0
);
perform_window_command
(
hwnd
,
WS_MINIMIZEBOX
,
WS_MINIMIZE
,
SC_MINIMIZE
,
HTMINBUTTON
);
}
...
...
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