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
512237eb
Commit
512237eb
authored
Aug 30, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Aug 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Consolidate the code for managing the Cocoa parent/child window relationship.
parent
6873c3ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
19 deletions
+56
-19
cocoa_window.m
dlls/winemac.drv/cocoa_window.m
+56
-19
No files found.
dlls/winemac.drv/cocoa_window.m
View file @
512237eb
...
...
@@ -670,6 +670,55 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
forWindow
:
self
];
}
-
(
BOOL
)
addChildWineWindow
:
(
WineWindow
*
)
child
assumeVisible
:
(
BOOL
)
assumeVisible
{
BOOL
reordered
=
FALSE
;
if
([
self
isVisible
]
&&
(
assumeVisible
||
[
child
isVisible
]))
{
if
([
self
level
]
>
[
child
level
])
[
child
setLevel
:[
self
level
]];
[
self
addChildWindow
:
child
ordered
:
NSWindowAbove
];
child
.
latentParentWindow
=
nil
;
reordered
=
TRUE
;
}
else
child
.
latentParentWindow
=
self
;
return
reordered
;
}
-
(
BOOL
)
addChildWineWindow
:
(
WineWindow
*
)
child
{
return
[
self
addChildWineWindow
:
child
assumeVisible
:
FALSE
];
}
-
(
void
)
removeChildWineWindow
:
(
WineWindow
*
)
child
{
[
self
removeChildWindow
:
child
];
if
(
child
.
latentParentWindow
==
self
)
child
.
latentParentWindow
=
nil
;
}
-
(
BOOL
)
becameEligibleParentOrChild
{
// If we aren't visible currently, we assume that we should be and soon
// will be. So, if the latent parent is visible that's enough to assume
// we can establish the parent-child relationship in Cocoa. That will
// actually make us visible, which is fine.
return
[
latentParentWindow
addChildWineWindow
:
self
assumeVisible
:
TRUE
];
}
-
(
void
)
becameIneligibleParentOrChild
{
WineWindow
*
parent
=
(
WineWindow
*
)[
self
parentWindow
];
if
(
parent
)
{
self
.
latentParentWindow
=
parent
;
[
parent
removeChildWindow
:
self
];
}
}
// Determine if, among Wine windows, this window is directly above or below
// a given other Wine window with no other Wine window intervening.
// Intervening non-Wine windows are ignored.
...
...
@@ -786,14 +835,9 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
NSDisableScreenUpdates
();
if
(
latentParentWindow
)
{
if
([
latentParentWindow
level
]
>
[
self
level
])
[
self
setLevel
:[
latentParentWindow
level
]];
[
latentParentWindow
addChildWindow
:
self
ordered
:
NSWindowAbove
];
self
.
latentParentWindow
=
nil
;
if
([
self
becameEligibleParentOrChild
])
needAdjustWindowLevels
=
TRUE
;
}
if
(
prev
||
next
)
{
WineWindow
*
other
=
[
prev
isVisible
]
?
prev
:
next
;
...
...
@@ -867,8 +911,8 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
if
([
self
isMiniaturized
])
pendingMinimize
=
TRUE
;
self
.
latentParentWindow
=
[
self
parentWindow
];
[
latentParentWindow
removeChildWindow
:
self
];
[
self
becameIneligibleParentOrChild
];
[
self
orderOut
:
nil
];
if
(
wasVisible
&&
wasOnActiveSpace
&&
fullscreen
)
[
controller
updateFullscreenWindows
];
...
...
@@ -952,17 +996,10 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
WineWindow
*
oldParent
=
(
WineWindow
*
)[
self
parentWindow
];
if
((
oldParent
&&
oldParent
!=
parent
)
||
(
!
oldParent
&&
latentParentWindow
!=
parent
))
{
[[
self
parentWindow
]
removeChildWindow
:
self
];
self
.
latentParentWindow
=
nil
;
if
([
self
isVisible
]
&&
parent
)
{
if
([
parent
level
]
>
[
self
level
])
[
self
setLevel
:[
parent
level
]];
[
parent
addChildWindow
:
self
ordered
:
NSWindowAbove
];
[
oldParent
removeChildWineWindow
:
self
];
[
latentParentWindow
removeChildWineWindow
:
self
];
if
([
parent
addChildWineWindow
:
self
])
[[
WineApplicationController
sharedController
]
adjustWindowLevels
];
}
else
self
.
latentParentWindow
=
parent
;
}
}
...
...
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