>>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
Angus> Grand. Patch committed. Angus> Jean-Marc, attached is the equivalent patch against 1.3.x. Angus> Please add to your list of pending patches. Angus, I think you have been too fast for me there... I did not have time to tell you so, but I do not think this patch is appropriate after all. Actually, I have had a lot of interaction with Bennett Helm on the subject. That this interaction was private is certainly a bad thing and we have to change that. The situation with Qt/Mac, as I understand it, is the following: 1/ the focus problem that this patch fixes is gone with qt 3.3.x. This is good, because the 1.4.x will use that (while 1.3.x is stuck with qt 3.1 for simplicity). 2/ when giving proper parents to dialogs, they get 'always on top' behaviour, and this is not very convenient, according to Bennett's testing. 3/ the remaining problem that we had yet to solve is that (without your patch) the application menu is replaced with an empty one when a dialog has focus, which is not very intuitive for mac users. However, the qt docs states that the same menu will be used by all windows if the menubar is not attached to any window. So my plan was to tweak the qt menubar code so that the menus are not added to QMainWindow::menuBar(), but to some private menubar_ member (only for Q_WS_MAC, of course). I think this will do what we want. Then a second problem will be to make menu entries that are relevant to a document inactive when the active window is not the main window. I attach a patch I sent to Bennett to do this. Bennett old me that the patch does not work, but the intent should be clear enough. Sorry for the interference. Bennett, we should definitely continue these discussions, on lyx-devel. JMarc
Index: src/frontends/qt2/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ChangeLog,v retrieving revision 1.684 diff -u -p -r1.684 ChangeLog --- src/frontends/qt2/ChangeLog 5 May 2004 09:33:20 -0000 1.684 +++ src/frontends/qt2/ChangeLog 10 May 2004 13:35:37 -0000 @@ -1,3 +1,8 @@ +2004-05-10 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> + + * lyx_gui.C (getStatus): under Mac OS X, disable the + buffer-related lfuns when the main window does not have the focus. + 2004-05-05 Angus Leeming <[EMAIL PROTECTED]> * QIndexDialog.[Ch] (reject): overload the QDialog::reject function Index: src/frontends/qt2/lyx_gui.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/lyx_gui.C,v retrieving revision 1.62 diff -u -p -r1.62 lyx_gui.C --- src/frontends/qt2/lyx_gui.C 3 Apr 2004 08:37:10 -0000 1.62 +++ src/frontends/qt2/lyx_gui.C 10 May 2004 13:35:37 -0000 @@ -241,6 +241,17 @@ FuncStatus getStatus(FuncRequest const & default: break; } + +#ifdef Q_WS_MACX + // In LyX/Mac, when a dialog is open, the menus of the + // application can still be accessed without giving focus to + // the main window. In this case, we want to disable the menu + // entries that are buffer-related. + if (qApp->activeWindow() != qApp->mainWidget() + && !lyxaction.funcHasFlag(ev.action, LyXAction::NoBuffer)) + flag.enabled(false); +#endif + return flag; }