Avoid crash without XWayland

Summary: readX11ShadowProperty fails without an X connection

Test Plan: Tested by Kai who didn't have xwayland

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21965
This commit is contained in:
David Edmundson 2019-06-23 17:58:49 +02:00
parent bc97232dfd
commit 515f3cbb4e

View file

@ -124,7 +124,7 @@ Shadow *Shadow::createShadowFromWayland(Toplevel *toplevel)
QVector< uint32_t > Shadow::readX11ShadowProperty(xcb_window_t id)
{
QVector<uint32_t> ret;
if (id != XCB_WINDOW) {
if (id != XCB_WINDOW_NONE) {
Xcb::Property property(false, id, atoms->kde_net_wm_shadow, XCB_ATOM_CARDINAL, 0, 12);
uint32_t *shadow = property.value<uint32_t*>();
if (shadow) {