From 17e38f3357b89fbc87b29ac60a70428463cbe63d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 8 May 2013 17:28:55 +0200 Subject: [PATCH] Remove "Block global shortcuts" global shortcut This shortcut did not make any sense to me, because you could block the global shortcuts for KWin, but not re-enable them again. So once blocked, it was blocked for ever till kwin --replace &. This is in opposite to the commit message which introduced it (see BUG 108961). REVIEW: 110364 --- kwinbindings.cpp | 1 - workspace.cpp | 31 ++----------------------------- workspace.h | 6 +----- 3 files changed, 3 insertions(+), 35 deletions(-) diff --git a/kwinbindings.cpp b/kwinbindings.cpp index 24fbbca6b..9ca9319a6 100644 --- a/kwinbindings.cpp +++ b/kwinbindings.cpp @@ -164,7 +164,6 @@ DEF(I18N_NOOP("Switch to Previous Screen"), 0, slotSwitchToPrevScreen()); a = actionCollection->addAction("Group:Miscellaneous"); a->setText(i18n("Miscellaneous")); DEF(I18N_NOOP("Kill Window"), Qt::CTRL + Qt::ALT + Qt::Key_Escape, slotKillWindow()); -DEF(I18N_NOOP("Block Global Shortcuts"), 0, slotDisableGlobalShortcuts()); DEF(I18N_NOOP("Suspend Compositing"), Qt::SHIFT + Qt::ALT + Qt::Key_F12, slotToggleCompositing()); DEF(I18N_NOOP("Invert Screen Colors"), 0, slotInvertScreen()); diff --git a/workspace.cpp b/workspace.cpp index cf92b5f0f..43b3c5ade 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -131,7 +131,6 @@ Workspace::Workspace(bool restore) , disable_shortcuts_keys(NULL) , client_keys_dialog(NULL) , client_keys_client(NULL) - , global_shortcuts_disabled(false) , global_shortcuts_disabled_for_client(false) , workspaceInit(true) , startup(0) @@ -1369,39 +1368,14 @@ void Workspace::resetShowingDesktop(bool keep_hidden) --block_showing_desktop; } -/** - * Activating/deactivating this feature works like this: - * When nothing is active, and the shortcut is pressed, global shortcuts are disabled - * (using global_shortcuts_disabled) - * When a window that has disabling forced is activated, global shortcuts are disabled. - * (using global_shortcuts_disabled_for_client) - * When a shortcut is pressed and global shortcuts are disabled (either by a shortcut - * or for a client), they are enabled again. - */ -void Workspace::slotDisableGlobalShortcuts() -{ - if (global_shortcuts_disabled || global_shortcuts_disabled_for_client) - disableGlobalShortcuts(false); - else - disableGlobalShortcuts(true); -} - static bool pending_dfc = false; void Workspace::disableGlobalShortcutsForClient(bool disable) { if (global_shortcuts_disabled_for_client == disable) return; - if (!global_shortcuts_disabled) { - if (disable) - pending_dfc = true; - KGlobalSettings::self()->emitChange(KGlobalSettings::BlockShortcuts, disable); - // KWin will get the kipc message too - } -} - -void Workspace::disableGlobalShortcuts(bool disable) -{ + if (disable) + pending_dfc = true; KGlobalSettings::self()->emitChange(KGlobalSettings::BlockShortcuts, disable); // KWin will get the kipc message too } @@ -1412,7 +1386,6 @@ void Workspace::slotBlockShortcuts(int data) global_shortcuts_disabled_for_client = true; pending_dfc = false; } else { - global_shortcuts_disabled = data; global_shortcuts_disabled_for_client = false; } // Update also Alt+LMB actions etc. diff --git a/workspace.h b/workspace.h index 53b7468fb..e278b9885 100644 --- a/workspace.h +++ b/workspace.h @@ -267,7 +267,6 @@ public: void clientShortcutUpdated(Client* c); bool shortcutAvailable(const KShortcut& cut, Client* ignore = NULL) const; bool globalShortcutsDisabled() const; - void disableGlobalShortcuts(bool disable); void disableGlobalShortcutsForClient(bool disable); void sessionSaveStarted(); @@ -358,8 +357,6 @@ public slots: void slotWindowToDesktopUp(); void slotWindowToDesktopDown(); - void slotDisableGlobalShortcuts(); - void slotSettingsChanged(int category); void reconfigure(); @@ -518,7 +515,6 @@ private: KActionCollection* disable_shortcuts_keys; ShortcutDialog* client_keys_dialog; Client* client_keys_client; - bool global_shortcuts_disabled; bool global_shortcuts_disabled_for_client; // Timer to collect requests for 'reconfigure' @@ -653,7 +649,7 @@ inline bool Workspace::showingDesktop() const inline bool Workspace::globalShortcutsDisabled() const { - return global_shortcuts_disabled || global_shortcuts_disabled_for_client; + return global_shortcuts_disabled_for_client; } inline void Workspace::forceRestacking()