diff --git a/kwinbindings.cpp b/kwinbindings.cpp index 4448f7680f..4ea6429321 100644 --- a/kwinbindings.cpp +++ b/kwinbindings.cpp @@ -39,6 +39,9 @@ along with this program. If not, see . #define DEF4( name, descr, key, functor ) \ initShortcut(QStringLiteral(name), i18n(descr), key, functor); +#define DEF5( name, key, functor, value ) \ + initShortcut(QStringLiteral(name).arg(value), i18n(name, value), key, functor, value); + DEF(I18N_NOOP("Walk Through Window Tabs"), 0, slotActivateNextTab); DEF(I18N_NOOP("Walk Through Window Tabs (Reverse)"), 0, slotActivatePrevTab); @@ -129,7 +132,7 @@ DEF2("Window On All Desktops", I18N_NOOP("Keep Window on All Desktops"), 0, slotWindowOnAllDesktops); for (int i = 1; i < 21; ++i) { - DEF3(I18N_NOOP("Window to Desktop %1"), 0, slotWindowToDesktop, i); + DEF5(I18N_NOOP("Window to Desktop %1"), 0, std::bind(&Workspace::slotWindowToDesktop, this, i), i); } DEF(I18N_NOOP("Window to Next Desktop"), 0, slotWindowToNextDesktop); DEF(I18N_NOOP("Window to Previous Desktop"), 0, slotWindowToPreviousDesktop); diff --git a/useractions.cpp b/useractions.cpp index 850d826237..c3a0360dc4 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -1247,10 +1247,9 @@ static uint senderValue(QObject *sender) #define USABLE_ACTIVE_CLIENT (active_client && !(active_client->isDesktop() || active_client->isDock())) -void Workspace::slotWindowToDesktop() +void Workspace::slotWindowToDesktop(uint i) { if (USABLE_ACTIVE_CLIENT) { - const uint i = senderValue(sender()); if (i < 1) return; diff --git a/workspace.h b/workspace.h index 0b3ac42d89..2030043068 100644 --- a/workspace.h +++ b/workspace.h @@ -383,7 +383,7 @@ public Q_SLOTS: void performWindowOperation(KWin::AbstractClient* c, Options::WindowOperation op); // Keybindings //void slotSwitchToWindow( int ); - void slotWindowToDesktop(); + void slotWindowToDesktop(uint i); //void slotWindowToListPosition( int ); void slotSwitchToScreen();