From 7ade50ecbd7dd851684f4e3e5bb5cb92fa1d9a15 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Fri, 23 Sep 2011 13:01:57 +0000 Subject: made the "have to sometimes focus menu bar"-problem less annoying. the menu bar is ONLY selected now when we switch to a non-MDI-subwin which shares tool- and menubar (because this is the only case where it's necessary) tiny indentation fix in dcanvas.cpp --- muse2/muse/app.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'muse2/muse/app.cpp') diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index 84b5121c..1fcfef56 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -3102,9 +3102,15 @@ void MusE::activeTopWinChangedSlot(TopWin* win) { if (MusEGlobal::debugMsg) printf("ACTIVE TOPWIN CHANGED to '%s' (%p)\n", win ? win->windowTitle().toAscii().data() : "", win); - if ((win==NULL) || (win->isMdiWin()==false)) + if (win && (win->isMdiWin()==false) && win->sharesToolsAndMenu()) { - if (MusEGlobal::debugMsg) printf(" that's out of the MDI area\n"); + if (MusEGlobal::debugMsg) printf(" that's a menu sharing muse window which isn't inside the MDI area.\n"); + // if a window gets active which a) is a muse window, b) is not a mdi subwin and c) shares menu- and toolbar, + // then unfocus the MDI area and/or the currently active MDI subwin. otherwise you'll be unable to use win's + // tools or menu entries, as whenever you click at them, they're replaced by the currently active MDI subwin's + // menus and toolbars. + // as unfocusing the MDI area and/or the subwin does not work for some reason, we must do this workaround: + // simply focus anything in the main window except the mdi area. menuBar()->setFocus(Qt::MenuBarFocusReason); } -- cgit v1.2.3