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
84903c5d
Commit
84903c5d
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: Track latent child windows (the inverse of the latent parent window relationship).
This allows the relationship to be restored when the window becomes eligible again.
parent
a68d0a24
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
3 deletions
+76
-3
cocoa_window.h
dlls/winemac.drv/cocoa_window.h
+1
-0
cocoa_window.m
dlls/winemac.drv/cocoa_window.m
+75
-3
No files found.
dlls/winemac.drv/cocoa_window.h
View file @
84903c5d
...
...
@@ -32,6 +32,7 @@
BOOL
fullscreen
;
BOOL
pendingMinimize
;
WineWindow
*
latentParentWindow
;
NSMutableArray
*
latentChildWindows
;
void
*
hwnd
;
WineEventQueue
*
queue
;
...
...
dlls/winemac.drv/cocoa_window.m
View file @
84903c5d
...
...
@@ -537,6 +537,7 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[
liveResizeDisplayTimer
invalidate
];
[
liveResizeDisplayTimer
release
];
[
queue
release
];
[
latentChildWindows
release
];
[
latentParentWindow
release
];
[
shape
release
];
[
super
dealloc
];
...
...
@@ -679,11 +680,18 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
if
([
self
level
]
>
[
child
level
])
[
child
setLevel
:[
self
level
]];
[
self
addChildWindow
:
child
ordered
:
NSWindowAbove
];
[
latentChildWindows
removeObjectIdenticalTo
:
child
];
child
.
latentParentWindow
=
nil
;
reordered
=
TRUE
;
}
else
{
if
(
!
latentChildWindows
)
latentChildWindows
=
[[
NSMutableArray
alloc
]
init
];
if
(
!
[
latentChildWindows
containsObject
:
child
])
[
latentChildWindows
addObject
:
child
];
child
.
latentParentWindow
=
self
;
}
return
reordered
;
}
...
...
@@ -698,15 +706,52 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[
self
removeChildWindow
:
child
];
if
(
child
.
latentParentWindow
==
self
)
child
.
latentParentWindow
=
nil
;
[
latentChildWindows
removeObjectIdenticalTo
:
child
];
}
-
(
BOOL
)
becameEligibleParentOrChild
{
BOOL
reordered
=
FALSE
;
NSUInteger
count
;
// 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
];
if
([
latentParentWindow
addChildWineWindow
:
self
assumeVisible
:
TRUE
])
reordered
=
TRUE
;
// Here, though, we may not actually be visible yet and adding a child
// won't make us visible. The caller will have to call this method
// again after actually making us visible.
if
([
self
isVisible
]
&&
(
count
=
[
latentChildWindows
count
]))
{
NSMutableIndexSet
*
indexesToRemove
=
[
NSMutableIndexSet
indexSet
];
NSUInteger
i
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
WineWindow
*
child
=
[
latentChildWindows
objectAtIndex
:
i
];
if
([
child
isVisible
])
{
if
(
child
.
latentParentWindow
==
self
)
{
if
([
self
level
]
>
[
child
level
])
[
child
setLevel
:[
self
level
]];
[
self
addChildWindow
:
child
ordered
:
NSWindowAbove
];
child
.
latentParentWindow
=
nil
;
reordered
=
TRUE
;
}
else
ERR
(
@"shouldn't happen: %@ thinks %@ is a latent child, but it doesn't agree
\n
"
,
self
,
child
);
[
indexesToRemove
addIndex
:
i
];
}
}
[
latentChildWindows
removeObjectsAtIndexes
:
indexesToRemove
];
}
return
reordered
;
}
-
(
void
)
becameIneligibleParentOrChild
...
...
@@ -716,6 +761,9 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
if
(
parent
)
{
if
(
!
parent
->
latentChildWindows
)
parent
->
latentChildWindows
=
[[
NSMutableArray
alloc
]
init
];
[
parent
->
latentChildWindows
insertObject
:
self
atIndex
:
0
];
self
.
latentParentWindow
=
parent
;
[
parent
removeChildWindow
:
self
];
}
...
...
@@ -723,11 +771,18 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
if
([
childWindows
count
])
{
WineWindow
*
child
;
for
(
child
in
[[
childWindows
copy
]
autorelease
])
childWindows
=
[[
childWindows
copy
]
autorelease
];
for
(
child
in
childWindows
)
{
child
.
latentParentWindow
=
self
;
[
self
removeChildWindow
:
child
];
}
if
(
latentChildWindows
)
[
latentChildWindows
replaceObjectsInRange
:
NSMakeRange
(
0
,
0
)
withObjectsFromArray
:
childWindows
];
else
latentChildWindows
=
[
childWindows
mutableCopy
];
}
}
...
...
@@ -887,6 +942,10 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[
self
orderFront
:
nil
];
needAdjustWindowLevels
=
TRUE
;
}
if
([
self
becameEligibleParentOrChild
])
needAdjustWindowLevels
=
TRUE
;
if
(
needAdjustWindowLevels
)
{
if
(
!
wasVisible
&&
fullscreen
&&
[
self
isOnActiveSpace
])
...
...
@@ -1406,7 +1465,20 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
-
(
void
)
windowWillClose
:
(
NSNotification
*
)
notification
{
self
.
latentParentWindow
=
nil
;
WineWindow
*
child
;
if
(
latentParentWindow
)
{
[
latentParentWindow
->
latentChildWindows
removeObjectIdenticalTo
:
self
];
self
.
latentParentWindow
=
nil
;
}
for
(
child
in
latentChildWindows
)
{
if
(
child
.
latentParentWindow
==
self
)
child
.
latentParentWindow
=
nil
;
}
[
latentChildWindows
removeAllObjects
];
}
-
(
void
)
windowWillMiniaturize
:
(
NSNotification
*
)
notification
...
...
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