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
b3f71fde
Commit
b3f71fde
authored
Jan 11, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Jan 11, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Implement the Mac "Window" menu.
parent
15d4b2ab
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
cocoa_app.m
dlls/winemac.drv/cocoa_app.m
+11
-0
cocoa_window.m
dlls/winemac.drv/cocoa_window.m
+26
-0
No files found.
dlls/winemac.drv/cocoa_app.m
View file @
b3f71fde
...
...
@@ -51,7 +51,18 @@
[
item
setSubmenu
:
submenu
];
[
mainMenu
addItem
:
item
];
submenu
=
[[[
NSMenu
alloc
]
initWithTitle
:
@"Window"
]
autorelease
];
[
submenu
addItemWithTitle
:
@"Minimize"
action
:
@selector
(
performMiniaturize
:
)
keyEquivalent
:
@""
];
[
submenu
addItemWithTitle
:
@"Zoom"
action
:
@selector
(
performZoom
:
)
keyEquivalent
:
@""
];
[
submenu
addItem
:[
NSMenuItem
separatorItem
]];
[
submenu
addItemWithTitle
:
@"Bring All to Front"
action
:
@selector
(
arrangeInFront
:
)
keyEquivalent
:
@""
];
item
=
[[[
NSMenuItem
alloc
]
init
]
autorelease
];
[
item
setTitle
:
@"Window"
];
[
item
setSubmenu
:
submenu
];
[
mainMenu
addItem
:
item
];
[
self
setMainMenu
:
mainMenu
];
[
self
setWindowsMenu
:
submenu
];
}
}
...
...
dlls/winemac.drv/cocoa_window.m
View file @
b3f71fde
...
...
@@ -172,9 +172,17 @@ static BOOL frame_intersects_screens(NSRect frame, NSArray* screens)
else
behavior
|=
NSWindowCollectionBehaviorManaged
;
if
(
state
->
excluded_by_cycle
)
{
behavior
|=
NSWindowCollectionBehaviorIgnoresCycle
;
if
([
self
isVisible
])
[
NSApp
removeWindowsItem
:
self
];
}
else
{
behavior
|=
NSWindowCollectionBehaviorParticipatesInCycle
;
if
([
self
isVisible
])
[
NSApp
addWindowsItem
:
self
title
:[
self
title
]
filename
:
NO
];
}
[
self
setCollectionBehavior
:
behavior
];
}
...
...
@@ -196,6 +204,9 @@ static BOOL frame_intersects_screens(NSRect frame, NSArray* screens)
[
latentParentWindow
addChildWindow
:
self
ordered
:
NSWindowAbove
];
self
.
latentParentWindow
=
nil
;
}
if
(
!
[
self
isExcludedFromWindowsMenu
])
[
NSApp
addWindowsItem
:
self
title
:[
self
title
]
filename
:
NO
];
}
return
on_screen
;
...
...
@@ -206,6 +217,7 @@ static BOOL frame_intersects_screens(NSRect frame, NSArray* screens)
self
.
latentParentWindow
=
[
self
parentWindow
];
[
latentParentWindow
removeChildWindow
:
self
];
[
self
orderOut
:
nil
];
[
NSApp
removeWindowsItem
:
self
];
}
-
(
BOOL
)
setFrameIfOnScreen
:
(
NSRect
)
contentRect
...
...
@@ -277,6 +289,18 @@ static BOOL frame_intersects_screens(NSRect frame, NSArray* screens)
return
[
self
canBecomeKeyWindow
];
}
-
(
BOOL
)
isExcludedFromWindowsMenu
{
return
!
([
self
collectionBehavior
]
&
NSWindowCollectionBehaviorParticipatesInCycle
);
}
-
(
BOOL
)
validateMenuItem
:
(
NSMenuItem
*
)
menuItem
{
if
([
menuItem
action
]
==
@selector
(
makeKeyAndOrderFront
:
))
return
[
self
isKeyWindow
]
||
(
!
self
.
disabled
&&
!
self
.
noActivate
);
return
[
super
validateMenuItem
:
menuItem
];
}
/*
* ---------- NSWindowDelegate methods ----------
...
...
@@ -372,6 +396,8 @@ void macdrv_set_cocoa_window_title(macdrv_window w, const unsigned short* title,
titleString
=
@""
;
OnMainThreadAsync
(
^
{
[
window
setTitle
:
titleString
];
if
([
window
isVisible
]
&&
!
[
window
isExcludedFromWindowsMenu
])
[
NSApp
changeWindowsItem
:
window
title
:
titleString
filename
:
NO
];
});
[
pool
release
];
...
...
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