Commit 9c04d562 authored by Marco Martin's avatar Marco Martin
Browse files

Delay setPrimaryOutputName on X11 nativeeventfilter

if we do immediately setPrimaryOutputName, the name is still :0.0
because the app didn't have time to react yet (since here we are in the event filter,
we are just before that by definition) so the output name can still be wrong.

when we go from no outputs to one, at this point the name of the one QScreen
instane is still wrong :0.0 which will be renamed right after.

BUG:447936
parent 7aacf049
Pipeline #121349 passed with stage
in 7 minutes and 26 seconds
......@@ -18,6 +18,7 @@
#include <config-plasma.h>
#if HAVE_X11
#include <QTimer> //Used only in x11 case
#include <QX11Info>
#include <xcb/randr.h>
#include <xcb/xcb.h>
......@@ -122,7 +123,9 @@ bool PrimaryOutputWatcher::nativeEventFilter(const QByteArray &eventType, void *
const auto responseType = XCB_EVENT_RESPONSE_TYPE(ev);
if (responseType == m_xrandrExtensionOffset + XCB_RANDR_SCREEN_CHANGE_NOTIFY) {
setPrimaryOutputName(qGuiApp->primaryScreen()->name());
QTimer::singleShot(0, this, [this]() {
setPrimaryOutputName(qGuiApp->primaryScreen()->name());
});
}
#endif
return false;
......
Markdown is supported
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