diff options
author | Elvis Lee <kwangwoong.lee@lge.com> | 2021-02-18 15:45:49 +0900 |
---|---|---|
committer | Elvis Lee <kwangwoong.lee@lge.com> | 2021-03-04 09:06:12 +0000 |
commit | 3793a82038682db77966ea5daf8e75964e4250fe (patch) | |
tree | 141dc13c491737362d9e33f5dd7caa75149f482a /src/client/qwaylanddisplay.cpp | |
parent | 59f58108eecee65789bcea95e6f86242d3316955 (diff) | |
download | qtwayland-3793a82038682db77966ea5daf8e75964e4250fe.tar.gz |
Handle registry_global out of constructor
Factory functions in QWaylandDisplay::registry_global() can be overridden.
Later, other classes instantiated in the registry_global can support
platform specific implementation with inheritance and some factory function.
Change-Id: I92ce574e049b8c91587687cc7c30611f3dfdbe56
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/client/qwaylanddisplay.cpp')
-rw-r--r-- | src/client/qwaylanddisplay.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 6c226a35..a3a562be 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -162,13 +162,6 @@ QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration) if (!mXkbContext) qCWarning(lcQpaWayland, "failed to create xkb context"); #endif - - forceRoundTrip(); - - if (!mWaitingScreens.isEmpty()) { - // Give wl_output.done and zxdg_output_v1.done events a chance to arrive - forceRoundTrip(); - } } QWaylandDisplay::~QWaylandDisplay(void) @@ -193,6 +186,18 @@ QWaylandDisplay::~QWaylandDisplay(void) wl_display_disconnect(mDisplay); } +// Steps which is called just after constructor. This separates registry_global() out of the constructor +// so that factory functions in integration can be overridden. +void QWaylandDisplay::initialize() +{ + forceRoundTrip(); + + if (!mWaitingScreens.isEmpty()) { + // Give wl_output.done and zxdg_output_v1.done events a chance to arrive + forceRoundTrip(); + } +} + void QWaylandDisplay::ensureScreen() { if (!mScreens.empty() || mPlaceholderScreen) |