[wayland] Ensure to not call into x11 on Compositor tear-down

During Compositor tear down Xwayland is already destroyed. Thus it
doesn't make sense to try to delete the support properties: either
it freezes in xcb or it crashes because the connection is null.

At the same time we also ensure that the connection internally is
reset to null. Note: the one in kwinglobals.h caches and could cause
use-after-free errors. Any tear-down code must be migrated to
kwinApp()->x11Connection().
master
Martin Gräßlin 9 years ago
parent acb0dfd893
commit f75e53af60

@ -56,6 +56,7 @@ WaylandTestApplication::~WaylandTestApplication()
Xcb::setInputFocus(XCB_INPUT_FOCUS_POINTER_ROOT);
destroyAtoms();
xcb_disconnect(x11Connection());
setX11Connection(nullptr);
}
if (m_xwaylandProcess) {
m_xwaylandProcess->terminate();

@ -443,9 +443,11 @@ void Compositor::deleteUnusedSupportProperties()
m_unusedSupportPropertyTimer.start();
return;
}
foreach (const xcb_atom_t &atom, m_unusedSupportProperties) {
// remove property from root window
xcb_delete_property(connection(), rootWindow(), atom);
if (kwinApp()->x11Connection()) {
foreach (const xcb_atom_t &atom, m_unusedSupportProperties) {
// remove property from root window
xcb_delete_property(connection(), rootWindow(), atom);
}
}
}

@ -80,6 +80,7 @@ ApplicationWayland::~ApplicationWayland()
Xcb::setInputFocus(XCB_INPUT_FOCUS_POINTER_ROOT);
destroyAtoms();
xcb_disconnect(x11Connection());
setX11Connection(nullptr);
}
if (m_xwaylandProcess) {
m_xwaylandProcess->terminate();

Loading…
Cancel
Save