On Tue, Aug 12, 2014 at 4:07 PM, pdv <pdvissch...@edpnet.be> wrote: > As a follow-up on reports in the thread "LyX on OS X 10.9" from some months > ago, I build LyX(master) + Qt5(stable) (CMake + XCode). > > I replaced the Q_WS_MACX macro by Q_OS_MACX and QMaxStyle by QProxyStyle and > observed then (at least) 2 issues: > > 1) When starting up the menu bar is not visible; One must switch to another > app and then bring lyx to the foreground to make the menu bar appear. > 2) When closing the (last) window the menu bar disappears mostly, except for > the LyX menu. This was also reported by Stephan Witt, but I did observe no > crash. > > When closing the last window Qt5 should switch to the "default menu bar" but > apparently it doesn't find one and creates it's own minimal default menu > bar. > The default menu bar is created by GlobalMenuBar() (in GuiApplication.cpp) > which has a constructor GlobalMenuBar() : new QMenuBar(0); according to the > Qt docs the first parent-less QMenuBar created will be used as the default > menu bar. Apparently Qt5 does not detect the QMenuBar(0) created via a > subclass; > > When replacing the GlobalMenuBar() by a base QMenuBar(0) problem 2) is > solved. > > GlobalMenuBar() was introduced to override the event() function to handle > QEvent::ShortcutOverride events but shortcuts seem to work without using the > GlobalMenuBar (Cmd-Q and Cmd-, work as expected; Cmd-N and Cmd-O only work > after first activating one of them via the menu, but the latter also happens > in LyX211 and may not be related to Qt5). Building LyX + Qt4.8.6 confirms > that GlobalMenuBar's event() is not called when issuing a shortcut with no > window present. I assume that these standard mac-shortcuts are handled > automatically by Qt. > > If someone wants to check this, see the attached patch, which includes all > changes (but does not solve issue 1)).
I wonder if this is related to the Ubuntu issue that I and Abdel noticed: https://bugs.launchpad.net/ubuntu/+source/appmenu-qt5/+bug/1307619 For 1, does running LyX as lyx -x "ui-toggle menubar" fix it (or running that command twice directly in LyX from the command buffer)? Of course this is just a work around but I wonder if it helps narrow down the problem. Scott