From 8828bf4dbeb90e479b3b461905f974774d6e20a4 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 17 Aug 2017 13:20:04 +0200 Subject: Set window screen from wl_surface.enter and leave events Removes the pointer mScreen, which would previously cause a crash if the screen was removed. Ensures that QWindow::screen() is correct, except in the cases where: - The compositor has not yet sent enter and leave events (in which case the primary output is returned). - The compositor is not sending enter and leave events (although this is mandatory, some compositors don't do this). - The application developer has tried to move the window with QWindow::setScreen(QScreen *). Since there is no way for a client to ask to be moved to a specific monitor in windowed mode, we return the requested screen until a new enter or leave event is received. This will also be useful when implementing/fixing features where the current screen matters. Examples are QT_AUTO_SCREEN_SCALE_FACTOR and the optional output parameter to wl_shell_surface.set_fullscreen. Task-number: QTBUG-62044 Change-Id: Iafde2e278fbc8876e8dafe5b2a4d2482fdc7961a Reviewed-by: Paul Olav Tvete --- src/client/qwaylandscreen_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/client/qwaylandscreen_p.h') diff --git a/src/client/qwaylandscreen_p.h b/src/client/qwaylandscreen_p.h index b2900a964..3d4df6e66 100644 --- a/src/client/qwaylandscreen_p.h +++ b/src/client/qwaylandscreen_p.h @@ -99,6 +99,7 @@ public: ::wl_output *output() { return object(); } static QWaylandScreen *waylandScreenFromWindow(QWindow *window); + static QWaylandScreen *fromWlOutput(::wl_output *output); private: void output_mode(uint32_t flags, int width, int height, int refresh) override; -- cgit v1.2.3