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
54291ad3
Commit
54291ad3
authored
Sep 30, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Sep 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Let Wine always drive window minimization; Cocoa just requests it.
parent
e915cfd4
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
53 deletions
+58
-53
cocoa_window.h
dlls/winemac.drv/cocoa_window.h
+0
-1
cocoa_window.m
dlls/winemac.drv/cocoa_window.m
+11
-26
event.c
dlls/winemac.drv/event.c
+5
-5
macdrv.h
dlls/winemac.drv/macdrv.h
+1
-1
macdrv_cocoa.h
dlls/winemac.drv/macdrv_cocoa.h
+1
-1
window.c
dlls/winemac.drv/window.c
+40
-19
No files found.
dlls/winemac.drv/cocoa_window.h
View file @
54291ad3
...
...
@@ -58,7 +58,6 @@
NSSize
savedContentMinSize
;
NSSize
savedContentMaxSize
;
BOOL
ignore_windowMiniaturize
;
BOOL
ignore_windowDeminiaturize
;
BOOL
fakingClose
;
}
...
...
dlls/winemac.drv/cocoa_window.m
View file @
54291ad3
...
...
@@ -689,10 +689,7 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
if
(
state
->
minimized
&&
!
[
self
isMiniaturized
])
{
if
([
self
isVisible
])
{
ignore_windowMiniaturize
=
TRUE
;
[
self
miniaturize
:
nil
];
}
[
super
miniaturize
:
nil
];
else
pendingMinimize
=
TRUE
;
}
...
...
@@ -703,8 +700,7 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
}
/* Whatever events regarding minimization might have been in the queue are now stale. */
[
queue
discardEventsMatchingMask
:
event_mask_for_type
(
WINDOW_DID_MINIMIZE
)
|
event_mask_for_type
(
WINDOW_DID_UNMINIMIZE
)
[
queue
discardEventsMatchingMask
:
event_mask_for_type
(
WINDOW_DID_UNMINIMIZE
)
forWindow
:
self
];
}
...
...
@@ -1012,8 +1008,7 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
if
(
pendingMinimize
)
{
ignore_windowMiniaturize
=
TRUE
;
[
self
miniaturize
:
nil
];
[
super
miniaturize
:
nil
];
pendingMinimize
=
FALSE
;
}
...
...
@@ -1333,6 +1328,13 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[
super
sendEvent
:
event
];
}
-
(
void
)
miniaturize
:
(
id
)
sender
{
macdrv_event
*
event
=
macdrv_create_event
(
WINDOW_MINIMIZE_REQUESTED
,
self
);
[
queue
postEvent
:
event
];
macdrv_release_event
(
event
);
}
// We normally use the generic/calibrated RGB color space for the window,
// rather than the device color space, to avoid expensive color conversion
// which slows down drawing. However, for windows displaying OpenGL, having
...
...
@@ -1457,8 +1459,7 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
macdrv_event
*
event
;
/* Coalesce events by discarding any previous ones still in the queue. */
[
queue
discardEventsMatchingMask
:
event_mask_for_type
(
WINDOW_DID_MINIMIZE
)
|
event_mask_for_type
(
WINDOW_DID_UNMINIMIZE
)
[
queue
discardEventsMatchingMask
:
event_mask_for_type
(
WINDOW_DID_UNMINIMIZE
)
forWindow
:
self
];
event
=
macdrv_create_event
(
WINDOW_DID_UNMINIMIZE
,
self
);
...
...
@@ -1575,22 +1576,6 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
-
(
void
)
windowWillMiniaturize
:
(
NSNotification
*
)
notification
{
[
self
becameIneligibleParentOrChild
];
if
(
!
ignore_windowMiniaturize
)
{
macdrv_event
*
event
;
/* Coalesce events by discarding any previous ones still in the queue. */
[
queue
discardEventsMatchingMask
:
event_mask_for_type
(
WINDOW_DID_MINIMIZE
)
|
event_mask_for_type
(
WINDOW_DID_UNMINIMIZE
)
forWindow
:
self
];
event
=
macdrv_create_event
(
WINDOW_DID_MINIMIZE
,
self
);
[
queue
postEvent
:
event
];
macdrv_release_event
(
event
);
}
ignore_windowMiniaturize
=
FALSE
;
}
-
(
void
)
windowWillStartLiveResize
:
(
NSNotification
*
)
notification
...
...
dlls/winemac.drv/event.c
View file @
54291ad3
...
...
@@ -49,11 +49,11 @@ static const char *dbgstr_event(int type)
"STATUS_ITEM_MOUSE_BUTTON"
,
"STATUS_ITEM_MOUSE_MOVE"
,
"WINDOW_CLOSE_REQUESTED"
,
"WINDOW_DID_MINIMIZE"
,
"WINDOW_DID_UNMINIMIZE"
,
"WINDOW_FRAME_CHANGED"
,
"WINDOW_GOT_FOCUS"
,
"WINDOW_LOST_FOCUS"
,
"WINDOW_MINIMIZE_REQUESTED"
,
};
if
(
0
<=
type
&&
type
<
NUM_EVENT_TYPES
)
return
event_names
[
type
];
...
...
@@ -101,7 +101,6 @@ static macdrv_event_mask get_event_mask(DWORD mask)
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_MINIMIZE
);
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
);
...
...
@@ -112,6 +111,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_MINIMIZE_REQUESTED
);
}
return
event_mask
;
...
...
@@ -233,9 +233,6 @@ void macdrv_handle_event(const macdrv_event *event)
case
WINDOW_CLOSE_REQUESTED
:
macdrv_window_close_requested
(
hwnd
);
break
;
case
WINDOW_DID_MINIMIZE
:
macdrv_window_did_minimize
(
hwnd
);
break
;
case
WINDOW_DID_UNMINIMIZE
:
macdrv_window_did_unminimize
(
hwnd
);
break
;
...
...
@@ -248,6 +245,9 @@ void macdrv_handle_event(const macdrv_event *event)
case
WINDOW_LOST_FOCUS
:
macdrv_window_lost_focus
(
hwnd
,
event
);
break
;
case
WINDOW_MINIMIZE_REQUESTED
:
macdrv_window_minimize_requested
(
hwnd
);
break
;
default:
TRACE
(
" ignoring
\n
"
);
break
;
...
...
dlls/winemac.drv/macdrv.h
View file @
54291ad3
...
...
@@ -160,7 +160,7 @@ extern void macdrv_window_got_focus(HWND hwnd, const macdrv_event *event) DECLSP
extern
void
macdrv_window_lost_focus
(
HWND
hwnd
,
const
macdrv_event
*
event
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_app_deactivated
(
void
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_app_quit_requested
(
const
macdrv_event
*
event
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_window_
did_minimize
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_window_
minimize_requested
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_window_did_unminimize
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
BOOL
query_resize_end
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
BOOL
query_resize_start
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
...
...
dlls/winemac.drv/macdrv_cocoa.h
View file @
54291ad3
...
...
@@ -186,11 +186,11 @@ enum {
STATUS_ITEM_MOUSE_BUTTON
,
STATUS_ITEM_MOUSE_MOVE
,
WINDOW_CLOSE_REQUESTED
,
WINDOW_DID_MINIMIZE
,
WINDOW_DID_UNMINIMIZE
,
WINDOW_FRAME_CHANGED
,
WINDOW_GOT_FOCUS
,
WINDOW_LOST_FOCUS
,
WINDOW_MINIMIZE_REQUESTED
,
NUM_EVENT_TYPES
};
...
...
dlls/winemac.drv/window.c
View file @
54291ad3
...
...
@@ -1188,7 +1188,6 @@ UINT CDECL macdrv_ShowWindow(HWND hwnd, INT cmd, RECT *rect, UINT swp)
goto
done
;
if
(
thread_data
->
current_event
->
type
!=
WINDOW_FRAME_CHANGED
&&
thread_data
->
current_event
->
type
!=
WINDOW_DID_MINIMIZE
&&
thread_data
->
current_event
->
type
!=
WINDOW_DID_UNMINIMIZE
)
goto
done
;
...
...
@@ -1570,7 +1569,6 @@ void CDECL macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, UINT swp_flags,
if
(
!
thread_data
||
!
thread_data
->
current_event
||
thread_data
->
current_event
->
window
!=
data
->
cocoa_window
||
(
thread_data
->
current_event
->
type
!=
WINDOW_FRAME_CHANGED
&&
thread_data
->
current_event
->
type
!=
WINDOW_DID_MINIMIZE
&&
thread_data
->
current_event
->
type
!=
WINDOW_DID_UNMINIMIZE
))
{
sync_window_position
(
data
,
swp_flags
,
&
old_window_rect
,
&
old_whole_rect
);
...
...
@@ -1768,34 +1766,57 @@ void macdrv_app_deactivated(void)
/***********************************************************************
* macdrv_window_
did_minimize
* macdrv_window_
minimize_requested
*
* Handler for WINDOW_
DID_MINIMIZE
events.
* Handler for WINDOW_
MINIMIZE_REQUESTED
events.
*/
void
macdrv_window_
did_minimize
(
HWND
hwnd
)
void
macdrv_window_
minimize_requested
(
HWND
hwnd
)
{
struct
macdrv_win_data
*
data
;
DWORD
style
;
TRACE
(
"win %p
\n
"
,
hwnd
);
if
(
!
(
data
=
get_win_data
(
hwnd
)))
return
;
if
(
data
->
minimized
)
goto
done
;
HMENU
hSysMenu
;
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
;
}
data
->
minimized
=
TRUE
;
if
(
(
style
&
WS_MINIMIZEBOX
)
&&
!
(
style
&
WS_DISABLED
)
)
hSysMenu
=
GetSystemMenu
(
hwnd
,
FALSE
)
;
if
(
hSysMenu
)
{
TRACE
(
"minimizing win %p/%p
\n
"
,
hwnd
,
data
->
cocoa_window
);
release_win_data
(
data
);
SendMessageW
(
hwnd
,
WM_SYSCOMMAND
,
SC_MINIMIZE
,
0
);
UINT
state
=
GetMenuState
(
hSysMenu
,
SC_MINIMIZE
,
MF_BYCOMMAND
);
if
(
state
==
0xFFFFFFFF
||
(
state
&
(
MF_DISABLED
|
MF_GRAYED
)))
{
TRACE
(
"not minimizing win %p menu state 0x%08x
\n
"
,
hwnd
,
state
);
return
;
}
TRACE
(
"not minimizing win %p/%p style %08x
\n
"
,
hwnd
,
data
->
cocoa_window
,
style
);
}
done:
release_win_data
(
data
);
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
);
}
...
...
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