Delay performWindowOperation to next event cycle in UserActionsMenu
In case that the window operation results in destroying the window decoration we need to have the menu closed before the deco gets destroyed. Otherwise Qt crashes.
This commit is contained in:
parent
be9b9681db
commit
c2e0c13b7b
3 changed files with 9 additions and 3 deletions
|
@ -1219,5 +1219,6 @@ inline int KDecoration::height() const
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(KDecoration::QuickTileMode)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(KDecoration::QuickTileMode)
|
||||||
|
Q_DECLARE_METATYPE(KDecorationDefines::WindowOperation)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -770,7 +770,13 @@ void UserActionsMenu::slotWindowOperation(QAction *action)
|
||||||
};
|
};
|
||||||
if (!type.isEmpty())
|
if (!type.isEmpty())
|
||||||
helperDialog(type, c);
|
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<KDecorationDefines::WindowOperation>();
|
||||||
|
QMetaObject::invokeMethod(workspace(), "performWindowOperation",
|
||||||
|
Qt::QueuedConnection,
|
||||||
|
Q_ARG(KWin::Client*, c.data()),
|
||||||
|
Q_ARG(KDecorationDefines::WindowOperation, op));
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserActionsMenu::slotSendToDesktop(QAction *action)
|
void UserActionsMenu::slotSendToDesktop(QAction *action)
|
||||||
|
|
|
@ -233,8 +233,6 @@ public:
|
||||||
void updateOnAllDesktopsOfTransients(Client*);
|
void updateOnAllDesktopsOfTransients(Client*);
|
||||||
void checkTransients(xcb_window_t w);
|
void checkTransients(xcb_window_t w);
|
||||||
|
|
||||||
void performWindowOperation(Client* c, WindowOperation op);
|
|
||||||
|
|
||||||
void storeSession(KConfig* config, SMSavePhase phase);
|
void storeSession(KConfig* config, SMSavePhase phase);
|
||||||
void storeClient(KConfigGroup &cg, int num, Client *c);
|
void storeClient(KConfigGroup &cg, int num, Client *c);
|
||||||
void storeSubSession(const QString &name, QSet<QByteArray> sessionIds);
|
void storeSubSession(const QString &name, QSet<QByteArray> sessionIds);
|
||||||
|
@ -302,6 +300,7 @@ public:
|
||||||
bool compositing() const;
|
bool compositing() const;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
void performWindowOperation(KWin::Client* c, KDecorationDefines::WindowOperation op);
|
||||||
// Keybindings
|
// Keybindings
|
||||||
//void slotSwitchToWindow( int );
|
//void slotSwitchToWindow( int );
|
||||||
void slotWindowToDesktop();
|
void slotWindowToDesktop();
|
||||||
|
|
Loading…
Reference in a new issue