[99492] trunk/dports/aqua/qt4-mac

michaelld at macports.org michaelld at macports.org
Wed Nov 7 09:06:59 PST 2012


Revision: 99492
          http://trac.macports.org//changeset/99492
Author:   michaelld at macports.org
Date:     2012-11-07 09:06:59 -0800 (Wed, 07 Nov 2012)
Log Message:
-----------
qt4-mac : temporarily add upcoming 4.8.4 patch to fix menu state; fixes ticket #36591.  Not rev-bumping to avoid re-building for those not needing this fix.

Modified Paths:
--------------
    trunk/dports/aqua/qt4-mac/Portfile

Added Paths:
-----------
    trunk/dports/aqua/qt4-mac/files/patch-4.8.4-osx-native-menu-state-fix.diff

Modified: trunk/dports/aqua/qt4-mac/Portfile
===================================================================
--- trunk/dports/aqua/qt4-mac/Portfile	2012-11-07 16:55:44 UTC (rev 99491)
+++ trunk/dports/aqua/qt4-mac/Portfile	2012-11-07 17:06:59 UTC (rev 99492)
@@ -216,6 +216,11 @@
 patchfiles-append   \
     patch-tools_macdeployqt_shared_shared.cpp.diff
 
+# (25) temporary fix for Mac menu state; will be removed with 4.8.4.
+
+patchfiles-append   \
+    patch-4.8.4-osx-native-menu-state-fix.diff
+
 ###############################################
 
 # disable CCACHE for now (ticket #34856)

Added: trunk/dports/aqua/qt4-mac/files/patch-4.8.4-osx-native-menu-state-fix.diff
===================================================================
--- trunk/dports/aqua/qt4-mac/files/patch-4.8.4-osx-native-menu-state-fix.diff	                        (rev 0)
+++ trunk/dports/aqua/qt4-mac/files/patch-4.8.4-osx-native-menu-state-fix.diff	2012-11-07 17:06:59 UTC (rev 99492)
@@ -0,0 +1,77 @@
+--- src/gui/widgets/qmenu.cpp.orig
++++ src/gui/widgets/qmenu.cpp
+@@ -2387,7 +2387,7 @@ void QMenu::changeEvent(QEvent *e)
+         if (d->tornPopup) // torn-off menu
+             d->tornPopup->setEnabled(isEnabled());
+         d->menuAction->setEnabled(isEnabled());
+-#ifdef Q_WS_MAC
++#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
+         if (d->mac_menu)
+             d->setMacMenuEnabled(isEnabled());
+ #endif
+--- src/gui/widgets/qmenu_mac.mm.orig
++++ src/gui/widgets/qmenu_mac.mm
+@@ -1554,6 +1554,7 @@ QMenuPrivate::syncSeparatorsCollapsible(bool collapse)
+ 
+ 
+ 
++#ifndef QT_MAC_USE_COCOA
+ /*!
+   \internal
+ */
+@@ -1567,26 +1568,16 @@ void QMenuPrivate::setMacMenuEnabled(bool enable)
+         for (int i = 0; i < mac_menu->actionItems.count(); ++i) {
+             QMacMenuAction *menuItem = mac_menu->actionItems.at(i);
+             if (menuItem && menuItem->action && menuItem->action->isEnabled()) {
+-#ifndef QT_MAC_USE_COCOA
+                 // Only enable those items which contains an enabled QAction.
+                 // i == 0 -> the menu itself, hence i + 1 for items.
+                 EnableMenuItem(mac_menu->menu, i + 1);
+-#else
+-                [menuItem->menuItem setEnabled:true];
+-#endif
+             }
+         }
+     } else {
+-#ifndef QT_MAC_USE_COCOA
+         DisableAllMenuItems(mac_menu->menu);
+-#else
+-        NSMenu *menu = mac_menu->menu;
+-        for (NSMenuItem *item in [menu itemArray]) {
+-            [item setEnabled:false];
+-        }
+-#endif
+     }
+ }
++#endif
+ 
+ /*!
+     \internal
+@@ -1744,6 +1735,7 @@ QMenuBarPrivate::QMacMenuBarPrivate::syncAction(QMacMenuAction *action)
+         [item setSubmenu: submenu];
+         [submenu setTitle:qt_mac_QStringToNSString(qt_mac_removeMnemonics(action->action->text()))];
+         syncNSMenuItemVisiblity(item, visible);
++        syncNSMenuItemEnabled(item, action->action->isEnabled());
+ #endif
+         if (release_submenu) { //no pointers to it
+ #ifndef QT_MAC_USE_COCOA
+@@ -1846,6 +1838,7 @@ OSMenuRef QMenuBarPrivate::macMenu()
+         return 0;
+     } else if (!mac_menubar->menu) {
+         mac_menubar->menu = qt_mac_create_menu(q);
++        [mac_menubar->menu setAutoenablesItems:NO];
+         ProcessSerialNumber mine, front;
+         if (GetCurrentProcess(&mine) == noErr && GetFrontProcess(&front) == noErr) {
+             if (!qt_mac_no_menubar_merge && !mac_menubar->apple_menu) {
+--- src/gui/widgets/qmenu_p.h.orig
++++ src/gui/widgets/qmenu_p.h
+@@ -327,7 +327,9 @@ public:
+         }
+     } *mac_menu;
+     OSMenuRef macMenu(OSMenuRef merge);
++#ifndef QT_MAC_USE_COCOA
+     void setMacMenuEnabled(bool enable = true);
++#endif
+     void syncSeparatorsCollapsible(bool collapsible);
+     static QHash<OSMenuRef, OSMenuRef> mergeMenuHash;
+     static QHash<OSMenuRef, QMenuMergeList*> mergeMenuItemsHash;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20121107/f4e12a46/attachment.html>


More information about the macports-changes mailing list