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
f6924b96
Commit
f6924b96
authored
Jun 07, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Jun 07, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Honor requests to order owned windows relative to other owned windows of the same owner.
parent
b96b5655
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
cocoa_window.m
dlls/winemac.drv/cocoa_window.m
+59
-0
No files found.
dlls/winemac.drv/cocoa_window.m
View file @
f6924b96
...
...
@@ -710,6 +710,55 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
return
TRUE
;
}
-
(
void
)
order
:
(
NSWindowOrderingMode
)
mode
childWindow
:
(
WineWindow
*
)
child
relativeTo
:
(
WineWindow
*
)
other
{
NSMutableArray
*
windowNumbers
;
NSNumber
*
childWindowNumber
;
NSUInteger
otherIndex
;
NSMutableArray
*
children
;
// Get the z-order from the window server and modify it to reflect the
// requested window ordering.
windowNumbers
=
[[[[
self
class
]
windowNumbersWithOptions
:
0
]
mutableCopy
]
autorelease
];
childWindowNumber
=
[
NSNumber
numberWithInteger
:[
child
windowNumber
]];
[
windowNumbers
removeObject
:
childWindowNumber
];
otherIndex
=
[
windowNumbers
indexOfObject
:[
NSNumber
numberWithInteger
:[
other
windowNumber
]]];
[
windowNumbers
insertObject
:
childWindowNumber
atIndex
:
otherIndex
+
(
mode
==
NSWindowAbove
?
0
:
1
)];
// Get our child windows and sort them in the reverse of the desired
// z-order (back-to-front).
children
=
[[[
self
childWindows
]
mutableCopy
]
autorelease
];
[
children
sortWithOptions
:
NSSortStable
usingComparator
:
^
NSComparisonResult
(
id
obj1
,
id
obj2
){
NSNumber
*
window1Number
=
[
NSNumber
numberWithInteger
:[
obj1
windowNumber
]];
NSNumber
*
window2Number
=
[
NSNumber
numberWithInteger
:[
obj2
windowNumber
]];
NSUInteger
index1
=
[
windowNumbers
indexOfObject
:
window1Number
];
NSUInteger
index2
=
[
windowNumbers
indexOfObject
:
window2Number
];
if
(
index1
==
NSNotFound
)
{
if
(
index2
==
NSNotFound
)
return
NSOrderedSame
;
else
return
NSOrderedAscending
;
}
else
if
(
index2
==
NSNotFound
)
return
NSOrderedDescending
;
else
if
(
index1
<
index2
)
return
NSOrderedDescending
;
else
if
(
index2
<
index1
)
return
NSOrderedAscending
;
return
NSOrderedSame
;
}];
// Remove all of the child windows and re-add them back-to-front so they
// are in the desired order.
for
(
other
in
children
)
[
self
removeChildWindow
:
other
];
for
(
other
in
children
)
[
self
addChildWindow
:
other
ordered
:
NSWindowAbove
];
}
/* Returns whether or not the window was ordered in, which depends on if
its frame intersects any screen. */
-
(
BOOL
)
orderBelow
:
(
WineWindow
*
)
prev
orAbove
:
(
WineWindow
*
)
next
...
...
@@ -740,6 +789,9 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
if
(
!
[
self
isOrdered
:
orderingMode
relativeTo
:
other
])
{
WineWindow
*
parent
=
(
WineWindow
*
)[
self
parentWindow
];
WineWindow
*
otherParent
=
(
WineWindow
*
)[
other
parentWindow
];
// This window level may not be right for this window based
// on floating-ness, fullscreen-ness, etc. But we set it
// temporarily to allow us to order the windows properly.
...
...
@@ -747,6 +799,13 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
if
([
self
level
]
!=
[
other
level
])
[
self
setLevel
:[
other
level
]];
[
self
orderWindow
:
orderingMode
relativeTo
:[
other
windowNumber
]];
// The above call to -[NSWindow orderWindow:relativeTo:] won't
// reorder windows which are both children of the same parent
// relative to each other, so do that separately.
if
(
parent
&&
parent
==
otherParent
)
[
parent
order
:
orderingMode
childWindow
:
self
relativeTo
:
other
];
needAdjustWindowLevels
=
TRUE
;
}
}
...
...
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