Commit 0fea5325 authored by Martin Flöser's avatar Martin Flöser
Browse files

Delay closing of a window by one event cycle

This is an issue we already had in the past with Aurorae. When
closing a window the graphics scene crashes because the deco
gets destroyed before the code in the graphics scene finished
the execution.

With the port to QML this seemed to be fixed unless as it turns
out it throws an XIO error on closing:
fatal IO error 11 (Resource temporarily unavailable) on X server ":0"

This can be triggered using glxgears. Closing glxgears would
reliable crash Aurorae. To circumvent this issue we have to
delay the close by one event cycle using QMetaObject's
invokeMethod with a Qt::QueuedConnection.

This has also to be done in the useractions menu as the menu
is still open when the window closes causing the same problem
inside Aurorae.

BUG: 303450
FIXED-IN: 4.9.0
Reviewed-By: Thomas Lüking
parent 746923db
......@@ -427,6 +427,16 @@ int AuroraeClient::doubleClickInterval() const
return QApplication::doubleClickInterval();
}
void AuroraeClient::closeWindow()
{
QMetaObject::invokeMethod(qobject_cast< KDecorationUnstable* >(this), "doCloseWindow", Qt::QueuedConnection);
}
void AuroraeClient::doCloseWindow()
{
KDecorationUnstable::closeWindow();
}
} // namespace Aurorae
extern "C"
......
......@@ -143,9 +143,11 @@ public slots:
void titlePressed(Qt::MouseButton button, Qt::MouseButtons buttons);
void titleReleased(Qt::MouseButton button, Qt::MouseButtons buttons);
void titleMouseMoved(Qt::MouseButton button, Qt::MouseButtons buttons);
void closeWindow();
private slots:
void themeChanged();
void doCloseWindow();
private:
QGraphicsView *m_view;
......
......@@ -701,7 +701,7 @@ void Workspace::performWindowOperation(Client* c, Options::WindowOperation op)
c->performMouseCommand(Options::MouseUnrestrictedResize, cursorPos());
break;
case Options::CloseOp:
c->closeWindow();
QMetaObject::invokeMethod(c, "closeWindow", Qt::QueuedConnection);
break;
case Options::MaximizeOp:
c->maximize(c->maximizeMode() == Client::MaximizeFull
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment