From f00ec6ccd546134fe5e762df8fbb55835648bcd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sat, 23 Mar 2013 20:44:10 +0100 Subject: [PATCH] block screenswitch if active screen follows mouse also inform the user about this BUG: 183410 FIXED-IN: 4.11 REVIEW: 109678 --- useractions.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/useractions.cpp b/useractions.cpp index 67e726ae8e..7ccdbddaf3 100755 --- a/useractions.cpp +++ b/useractions.cpp @@ -1292,8 +1292,21 @@ void Workspace::slotWindowToDesktop() } } +static bool screenSwitchImpossible() +{ + if (!options->isActiveMouseScreen()) + return false; + QStringList args; + args << "--passivepopup" << i18n("The window manager is confgured to consider the screen with the mouse on it as active one.\n" + "Therefore it is not possible to switch to a screen explicitly.") << "20"; + KProcess::startDetached("kdialog", args); + return true; +} + void Workspace::slotSwitchToScreen() { + if (screenSwitchImpossible()) + return; const int i = senderValue(sender()); if (i > -1) setCurrentScreen(i); @@ -1301,6 +1314,8 @@ void Workspace::slotSwitchToScreen() void Workspace::slotSwitchToNextScreen() { + if (screenSwitchImpossible()) + return; setCurrentScreen((activeScreen() + 1) % numScreens()); }