winemac.drv: Improved App name on windows and menus (Mac Driver)

Vitor Marques vitor251093 at gmail.com
Wed Jun 10 09:48:35 CDT 2015


In the actual code, the Mac Driver uses the Bundle Name on the Hide and
Quit buttons, but not in the main menu item, which doesn't make sense since
that's the most important place for the app name. It's a very simple change
that surely will be very welcome to all Mac users. I've also attached the
patch in case Gmail's line-wrapping cause any trouble. Although I have not
tested, the changes are simple enough to be analyzed in sight. My system is
a Mac OS X 10.10.

---
 dlls/winemac.drv/cocoa_app.m | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m
index 82925c8..a9d98c6 100644
--- a/dlls/winemac.drv/cocoa_app.m
+++ b/dlls/winemac.drv/cocoa_app.m
@@ -214,14 +214,14 @@ - (void) transformProcessToForeground

             mainMenu = [[[NSMenu alloc] init] autorelease];

-            // Application menu
-            submenu = [[[NSMenu alloc] initWithTitle:@"Wine"] autorelease];
+            // Application name
             bundleName = [[NSBundle mainBundle]
objectForInfoDictionaryKey:(NSString*)kCFBundleNameKey];
+            if (!bundleName || ![bundleName lenght]) bundleName = @"Wine";

-            if ([bundleName length])
-                title = [NSString stringWithFormat:@"Hide %@", bundleName];
-            else
-                title = @"Hide";
+            // Application menu
+            submenu = [[[NSMenu alloc] initWithTitle:bundleName]
autorelease];
+
+            title = [NSString stringWithFormat:@"Hide %@", bundleName];
             item = [submenu addItemWithTitle:title action:@selector(hide:)
keyEquivalent:@""];

             item = [submenu addItemWithTitle:@"Hide Others"
action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
@@ -231,14 +231,11 @@ - (void) transformProcessToForeground

             [submenu addItem:[NSMenuItem separatorItem]];

-            if ([bundleName length])
-                title = [NSString stringWithFormat:@"Quit %@", bundleName];
-            else
-                title = @"Quit";
+            title = [NSString stringWithFormat:@"Quit %@", bundleName];
             item = [submenu addItemWithTitle:title
action:@selector(terminate:)
keyEquivalent:@"q"];
             [item setKeyEquivalentModifierMask:NSCommandKeyMask |
NSAlternateKeyMask];
             item = [[[NSMenuItem alloc] init] autorelease];
-            [item setTitle:@"Wine"];
+            [item setTitle:bundleName];
             [item setSubmenu:submenu];
             [mainMenu addItem:item];

-- 
1.9.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20150610/fbbf3916/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mac-driver.patch
Type: text/x-patch
Size: 2443 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20150610/fbbf3916/attachment-0001.bin>


More information about the wine-patches mailing list