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
icc-effect-5.14.5
Martin Gräßlin 2013-05-08 17:28:55 +02:00
parent 92bc318e45
commit 17e38f3357
3 changed files with 3 additions and 35 deletions

View File

@ -164,7 +164,6 @@ DEF(I18N_NOOP("Switch to Previous Screen"), 0, slotSwitchToPrevScreen());
a = actionCollection->addAction("Group:Miscellaneous"); a = actionCollection->addAction("Group:Miscellaneous");
a->setText(i18n("Miscellaneous")); a->setText(i18n("Miscellaneous"));
DEF(I18N_NOOP("Kill Window"), Qt::CTRL + Qt::ALT + Qt::Key_Escape, slotKillWindow()); 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("Suspend Compositing"), Qt::SHIFT + Qt::ALT + Qt::Key_F12, slotToggleCompositing());
DEF(I18N_NOOP("Invert Screen Colors"), 0, slotInvertScreen()); DEF(I18N_NOOP("Invert Screen Colors"), 0, slotInvertScreen());

View File

@ -131,7 +131,6 @@ Workspace::Workspace(bool restore)
, disable_shortcuts_keys(NULL) , disable_shortcuts_keys(NULL)
, client_keys_dialog(NULL) , client_keys_dialog(NULL)
, client_keys_client(NULL) , client_keys_client(NULL)
, global_shortcuts_disabled(false)
, global_shortcuts_disabled_for_client(false) , global_shortcuts_disabled_for_client(false)
, workspaceInit(true) , workspaceInit(true)
, startup(0) , startup(0)
@ -1369,39 +1368,14 @@ void Workspace::resetShowingDesktop(bool keep_hidden)
--block_showing_desktop; --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; static bool pending_dfc = false;
void Workspace::disableGlobalShortcutsForClient(bool disable) void Workspace::disableGlobalShortcutsForClient(bool disable)
{ {
if (global_shortcuts_disabled_for_client == disable) if (global_shortcuts_disabled_for_client == disable)
return; return;
if (!global_shortcuts_disabled) { if (disable)
if (disable) pending_dfc = true;
pending_dfc = true;
KGlobalSettings::self()->emitChange(KGlobalSettings::BlockShortcuts, disable);
// KWin will get the kipc message too
}
}
void Workspace::disableGlobalShortcuts(bool disable)
{
KGlobalSettings::self()->emitChange(KGlobalSettings::BlockShortcuts, disable); KGlobalSettings::self()->emitChange(KGlobalSettings::BlockShortcuts, disable);
// KWin will get the kipc message too // KWin will get the kipc message too
} }
@ -1412,7 +1386,6 @@ void Workspace::slotBlockShortcuts(int data)
global_shortcuts_disabled_for_client = true; global_shortcuts_disabled_for_client = true;
pending_dfc = false; pending_dfc = false;
} else { } else {
global_shortcuts_disabled = data;
global_shortcuts_disabled_for_client = false; global_shortcuts_disabled_for_client = false;
} }
// Update also Alt+LMB actions etc. // Update also Alt+LMB actions etc.

View File

@ -267,7 +267,6 @@ public:
void clientShortcutUpdated(Client* c); void clientShortcutUpdated(Client* c);
bool shortcutAvailable(const KShortcut& cut, Client* ignore = NULL) const; bool shortcutAvailable(const KShortcut& cut, Client* ignore = NULL) const;
bool globalShortcutsDisabled() const; bool globalShortcutsDisabled() const;
void disableGlobalShortcuts(bool disable);
void disableGlobalShortcutsForClient(bool disable); void disableGlobalShortcutsForClient(bool disable);
void sessionSaveStarted(); void sessionSaveStarted();
@ -358,8 +357,6 @@ public slots:
void slotWindowToDesktopUp(); void slotWindowToDesktopUp();
void slotWindowToDesktopDown(); void slotWindowToDesktopDown();
void slotDisableGlobalShortcuts();
void slotSettingsChanged(int category); void slotSettingsChanged(int category);
void reconfigure(); void reconfigure();
@ -518,7 +515,6 @@ private:
KActionCollection* disable_shortcuts_keys; KActionCollection* disable_shortcuts_keys;
ShortcutDialog* client_keys_dialog; ShortcutDialog* client_keys_dialog;
Client* client_keys_client; Client* client_keys_client;
bool global_shortcuts_disabled;
bool global_shortcuts_disabled_for_client; bool global_shortcuts_disabled_for_client;
// Timer to collect requests for 'reconfigure' // Timer to collect requests for 'reconfigure'
@ -653,7 +649,7 @@ inline bool Workspace::showingDesktop() const
inline bool Workspace::globalShortcutsDisabled() 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() inline void Workspace::forceRestacking()