summaryrefslogtreecommitdiff
path: root/muse2/muse/app.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-09-23 13:01:57 +0000
committerFlorian Jung <flo@windfisch.org>2011-09-23 13:01:57 +0000
commit7ade50ecbd7dd851684f4e3e5bb5cb92fa1d9a15 (patch)
tree70020a51f9a4d739c9011837277feded5cd4acc4 /muse2/muse/app.cpp
parent6f6c78229e4e1dee80d36c89c27e2e58e23e0eb3 (diff)
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
Diffstat (limited to 'muse2/muse/app.cpp')
-rw-r--r--muse2/muse/app.cpp10
1 files changed, 8 insertions, 2 deletions
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() : "<None>", 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);
}