diff --git a/shell/screenpool.h b/shell/screenpool.h --- a/shell/screenpool.h +++ b/shell/screenpool.h @@ -65,6 +65,7 @@ QHash m_idForConnector; QTimer m_configSaveTimer; + bool m_haveXrandr = false; int m_xrandrExtensionOffset; }; diff --git a/shell/screenpool.cpp b/shell/screenpool.cpp --- a/shell/screenpool.cpp +++ b/shell/screenpool.cpp @@ -45,7 +45,10 @@ if (KWindowSystem::isPlatformX11()) { qApp->installNativeEventFilter(this); const xcb_query_extension_reply_t* reply = xcb_get_extension_data(QX11Info::connection(), &xcb_randr_id); - m_xrandrExtensionOffset = reply->first_event; + if (reply) { + m_xrandrExtensionOffset = reply->first_event; + m_haveXrandr = true; + } } #endif } @@ -197,6 +200,10 @@ if (eventType[0] != 'x') { return false; } + + if (!m_haveXrandr) { + return false; + } xcb_generic_event_t *ev = static_cast(message);