From d30833dac7475d488eef70948cdf669444bc67cc Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Tue, 24 Jul 2007 17:10:36 +0000 Subject: [PATCH] Fix keyboard shortcuts when menu bar is hidden. Patch by Robin Stocker. Affects other KDE applications as well. See discussion on konsole-devel - http://lists.kde.org/?l=konsole-devel&m=118529209602516&w=2 svn path=/trunk/KDE/kdebase/apps/konsole/; revision=691938 --- TODO | 2 -- src/MainWindow.cpp | 7 +++++++ src/SessionController.cpp | 10 ++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index a3a78e18d..d6de69024 100644 --- a/TODO +++ b/TODO @@ -84,8 +84,6 @@ The KDE 4.0 TODO List: == BUGS == -- Shortcuts do not work when the menu bar is hidden. - - Allow the user to over-ride the "no Ctrl+[Key] shortcuts" limitation with shortcuts set in the configuration dialog, but warn the user if they try to do so. This is the behaviour in KDE 3. diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 323303b70..88a7ea9e2 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -81,6 +81,13 @@ MainWindow::MainWindow() // replace standard shortcuts which cannot be used in a terminal // (as they are reserved for use by terminal programs) correctShortcuts(); + + // add all actions to this window, so that the keyboard shortcuts can be + // used even when the menu is hidden + // + // See comments in SessionController constructor about Qt 4 behaviour with + // hidden menu bars and shortcuts + addActions(actionCollection()->actions()); } void MainWindow::correctShortcuts() diff --git a/src/SessionController.cpp b/src/SessionController.cpp index 8c35abf53..796f8c215 100644 --- a/src/SessionController.cpp +++ b/src/SessionController.cpp @@ -87,6 +87,16 @@ SessionController::SessionController(Session* session , TerminalDisplay* view, Q setXMLFile("konsole/sessionui.rc"); setupActions(); + // add all actions to this window, so that the keyboard shortcuts can be + // used even when the main window's menu is hidden + // + // TODO: The Qt-4 behaviour of shortcuts not working when the menu bar is hidden + // affects other KDE applications as well. A kdelibs fix might be possible. + // + // See discussion: + // http://lists.kde.org/?l=konsole-devel&m=118529209602516&w=2 + view->addActions(actionCollection()->actions()); + setIdentifier(_session->sessionId()); sessionTitleChanged();