diff --git a/libkdecorations/kdecoration.h b/libkdecorations/kdecoration.h index 0a20145e53..fb40259e23 100644 --- a/libkdecorations/kdecoration.h +++ b/libkdecorations/kdecoration.h @@ -1219,5 +1219,6 @@ inline int KDecoration::height() const /** @} */ Q_DECLARE_OPERATORS_FOR_FLAGS(KDecoration::QuickTileMode) +Q_DECLARE_METATYPE(KDecorationDefines::WindowOperation) #endif diff --git a/useractions.cpp b/useractions.cpp index 232d301b52..afb6c74a03 100755 --- a/useractions.cpp +++ b/useractions.cpp @@ -770,7 +770,13 @@ void UserActionsMenu::slotWindowOperation(QAction *action) }; if (!type.isEmpty()) helperDialog(type, c); - Workspace::self()->performWindowOperation(c.data(), op); + // need to delay performing the window operation as we need to have the + // user actions menu closed before we destroy the decoration. Otherwise Qt crashes + qRegisterMetaType(); + QMetaObject::invokeMethod(workspace(), "performWindowOperation", + Qt::QueuedConnection, + Q_ARG(KWin::Client*, c.data()), + Q_ARG(KDecorationDefines::WindowOperation, op)); } void UserActionsMenu::slotSendToDesktop(QAction *action) diff --git a/workspace.h b/workspace.h index 6b67070506..b4d4a098c1 100644 --- a/workspace.h +++ b/workspace.h @@ -233,8 +233,6 @@ public: void updateOnAllDesktopsOfTransients(Client*); void checkTransients(xcb_window_t w); - void performWindowOperation(Client* c, WindowOperation op); - void storeSession(KConfig* config, SMSavePhase phase); void storeClient(KConfigGroup &cg, int num, Client *c); void storeSubSession(const QString &name, QSet sessionIds); @@ -302,6 +300,7 @@ public: bool compositing() const; public Q_SLOTS: + void performWindowOperation(KWin::Client* c, KDecorationDefines::WindowOperation op); // Keybindings //void slotSwitchToWindow( int ); void slotWindowToDesktop();