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
ba86e677
Commit
ba86e677
authored
Feb 17, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Feb 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Track Cocoa windows in a z-ordered list.
parent
3799acb3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
109 additions
and
1 deletion
+109
-1
cocoa_app.h
dlls/winemac.drv/cocoa_app.h
+7
-0
cocoa_app.m
dlls/winemac.drv/cocoa_app.m
+63
-1
cocoa_window.m
dlls/winemac.drv/cocoa_window.m
+39
-0
No files found.
dlls/winemac.drv/cocoa_app.h
View file @
ba86e677
...
...
@@ -46,10 +46,13 @@
CGFloat
primaryScreenHeight
;
BOOL
primaryScreenHeightValid
;
NSMutableArray
*
orderedWineWindows
;
}
@property
(
nonatomic
)
CGEventSourceKeyboardType
keyboardType
;
@property
(
readonly
,
copy
,
nonatomic
)
NSEvent
*
lastFlagsChanged
;
@property
(
readonly
,
nonatomic
)
NSArray
*
orderedWineWindows
;
-
(
void
)
transformProcessToForeground
;
...
...
@@ -63,6 +66,10 @@
-
(
void
)
keyboardSelectionDidChange
;
-
(
void
)
wineWindow
:(
WineWindow
*
)
window
ordered
:(
NSWindowOrderingMode
)
order
relativeTo
:(
WineWindow
*
)
otherWindow
;
@end
void
OnMainThread
(
dispatch_block_t
block
);
...
...
dlls/winemac.drv/cocoa_app.m
View file @
ba86e677
...
...
@@ -38,6 +38,7 @@ int macdrv_err_on;
@implementation
WineApplication
@synthesize
keyboardType
,
lastFlagsChanged
;
@synthesize
orderedWineWindows
;
-
(
id
)
init
{
...
...
@@ -48,8 +49,9 @@ int macdrv_err_on;
eventQueuesLock
=
[[
NSLock
alloc
]
init
];
keyWindows
=
[[
NSMutableArray
alloc
]
init
];
orderedWineWindows
=
[[
NSMutableArray
alloc
]
init
];
if
(
!
eventQueues
||
!
eventQueuesLock
||
!
keyWindows
)
if
(
!
eventQueues
||
!
eventQueuesLock
||
!
keyWindows
||
!
orderedWineWindows
)
{
[
self
release
];
return
nil
;
...
...
@@ -60,6 +62,7 @@ int macdrv_err_on;
-
(
void
)
dealloc
{
[
orderedWineWindows
release
];
[
keyWindows
release
];
[
eventQueues
release
];
[
eventQueuesLock
release
];
...
...
@@ -251,6 +254,64 @@ int macdrv_err_on;
return
point
;
}
-
(
void
)
wineWindow
:
(
WineWindow
*
)
window
ordered
:
(
NSWindowOrderingMode
)
order
relativeTo
:
(
WineWindow
*
)
otherWindow
{
NSUInteger
index
;
switch
(
order
)
{
case
NSWindowAbove
:
[
window
retain
];
[
orderedWineWindows
removeObjectIdenticalTo
:
window
];
if
(
otherWindow
)
{
index
=
[
orderedWineWindows
indexOfObjectIdenticalTo
:
otherWindow
];
if
(
index
==
NSNotFound
)
index
=
0
;
}
else
{
index
=
0
;
for
(
otherWindow
in
orderedWineWindows
)
{
if
([
otherWindow
level
]
<=
[
window
level
])
break
;
index
++
;
}
}
[
orderedWineWindows
insertObject
:
window
atIndex
:
index
];
[
window
release
];
break
;
case
NSWindowBelow
:
[
window
retain
];
[
orderedWineWindows
removeObjectIdenticalTo
:
window
];
if
(
otherWindow
)
{
index
=
[
orderedWineWindows
indexOfObjectIdenticalTo
:
otherWindow
];
if
(
index
==
NSNotFound
)
index
=
[
orderedWineWindows
count
];
}
else
{
index
=
0
;
for
(
otherWindow
in
orderedWineWindows
)
{
if
([
otherWindow
level
]
<
[
window
level
])
break
;
index
++
;
}
}
[
orderedWineWindows
insertObject
:
window
atIndex
:
index
];
[
window
release
];
break
;
case
NSWindowOut
:
default
:
break
;
}
}
/*
* ---------- NSApplication method overrides ----------
...
...
@@ -307,6 +368,7 @@ int macdrv_err_on;
usingBlock
:^
(
NSNotification
*
note
){
NSWindow
*
window
=
[
note
object
];
[
keyWindows
removeObjectIdenticalTo
:
window
];
[
orderedWineWindows
removeObjectIdenticalTo
:
window
];
}];
[
nc
addObserver
:
self
...
...
dlls/winemac.drv/cocoa_window.m
View file @
ba86e677
...
...
@@ -380,12 +380,19 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[
NSApp
transformProcessToForeground
];
if
(
prev
)
{
[
self
orderWindow
:
NSWindowBelow
relativeTo
:[
prev
windowNumber
]];
[
NSApp
wineWindow
:
self
ordered
:
NSWindowBelow
relativeTo
:
prev
];
}
else
{
[
self
orderWindow
:
NSWindowAbove
relativeTo
:[
next
windowNumber
]];
[
NSApp
wineWindow
:
self
ordered
:
NSWindowAbove
relativeTo
:
next
];
}
if
(
latentParentWindow
)
{
[
latentParentWindow
addChildWindow
:
self
ordered
:
NSWindowAbove
];
[
NSApp
wineWindow
:
self
ordered
:
NSWindowAbove
relativeTo
:
latentParentWindow
];
self
.
latentParentWindow
=
nil
;
}
...
...
@@ -407,6 +414,7 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[
latentParentWindow
removeChildWindow
:
self
];
forceNextMouseMoveAbsolute
=
TRUE
;
[
self
orderOut
:
nil
];
[
NSApp
wineWindow
:
self
ordered
:
NSWindowOut
relativeTo
:
nil
];
[
NSApp
removeWindowsItem
:
self
];
}
...
...
@@ -467,7 +475,10 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[[
self
parentWindow
]
removeChildWindow
:
self
];
self
.
latentParentWindow
=
nil
;
if
([
self
isVisible
]
&&
parent
)
{
[
parent
addChildWindow
:
self
ordered
:
NSWindowAbove
];
[
NSApp
wineWindow
:
self
ordered
:
NSWindowAbove
relativeTo
:
parent
];
}
else
self
.
latentParentWindow
=
parent
;
}
...
...
@@ -556,12 +567,14 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
}
[
self
orderFront
:
nil
];
[
NSApp
wineWindow
:
self
ordered
:
NSWindowAbove
relativeTo
:
nil
];
causing_becomeKeyWindow
=
TRUE
;
[
self
makeKeyWindow
];
causing_becomeKeyWindow
=
FALSE
;
if
(
latentParentWindow
)
{
[
latentParentWindow
addChildWindow
:
self
ordered
:
NSWindowAbove
];
[
NSApp
wineWindow
:
self
ordered
:
NSWindowAbove
relativeTo
:
latentParentWindow
];
self
.
latentParentWindow
=
nil
;
}
if
(
!
[
self
isExcludedFromWindowsMenu
])
...
...
@@ -700,6 +713,9 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
{
if
([
event
type
]
==
NSLeftMouseDown
)
{
NSWindowButton
windowButton
;
BOOL
broughtWindowForward
=
TRUE
;
/* Since our windows generally claim they can't be made key, clicks
in their title bars are swallowed by the theme frame stuff. So,
we hook directly into the event stream and assume that any click
...
...
@@ -707,6 +723,27 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
accept. */
if
(
!
[
self
isKeyWindow
]
&&
!
self
.
disabled
&&
!
self
.
noActivate
)
[
NSApp
windowGotFocus
:
self
];
/* Any left-click on our window anyplace other than the close or
minimize buttons will bring it forward. */
for
(
windowButton
=
NSWindowCloseButton
;
windowButton
<=
NSWindowMiniaturizeButton
;
windowButton
++
)
{
NSButton
*
button
=
[[
event
window
]
standardWindowButton
:
windowButton
];
if
(
button
)
{
NSPoint
point
=
[
button
convertPoint
:[
event
locationInWindow
]
fromView
:
nil
];
if
([
button
mouse
:
point
inRect
:[
button
bounds
]])
{
broughtWindowForward
=
FALSE
;
break
;
}
}
}
if
(
broughtWindowForward
)
[
NSApp
wineWindow
:
self
ordered
:
NSWindowAbove
relativeTo
:
nil
];
}
[
super
sendEvent
:
event
];
...
...
@@ -908,6 +945,8 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
}
ignore_windowDeminiaturize
=
FALSE
;
[
NSApp
wineWindow
:
self
ordered
:
NSWindowAbove
relativeTo
:
nil
];
}
-
(
void
)
windowDidMove
:
(
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