diff --git a/plugins/platforms/wayland/egl_wayland_backend.cpp b/plugins/platforms/wayland/egl_wayland_backend.cpp index 40b6c3a8a7..adac99831d 100644 --- a/plugins/platforms/wayland/egl_wayland_backend.cpp +++ b/plugins/platforms/wayland/egl_wayland_backend.cpp @@ -78,6 +78,7 @@ bool EglWaylandOutput::init(EglWaylandBackend *backend) m_eglSurface = eglSurface; connect(m_waylandOutput, &WaylandOutput::sizeChanged, this, &EglWaylandOutput::updateSize); + connect(m_waylandOutput, &WaylandOutput::modeChanged, this, &EglWaylandOutput::updateMode); return true; } @@ -87,6 +88,11 @@ void EglWaylandOutput::updateSize(const QSize &size) wl_egl_window_resize(m_overlay, size.width(), size.height(), 0, 0); } +void EglWaylandOutput::updateMode() +{ + updateSize(m_waylandOutput->pixelSize()); +} + EglWaylandBackend::EglWaylandBackend(WaylandBackend *b) : AbstractEglBackend() , m_backend(b) diff --git a/plugins/platforms/wayland/egl_wayland_backend.h b/plugins/platforms/wayland/egl_wayland_backend.h index 7bd3392163..23ebbaba1a 100644 --- a/plugins/platforms/wayland/egl_wayland_backend.h +++ b/plugins/platforms/wayland/egl_wayland_backend.h @@ -46,6 +46,7 @@ public: bool init(EglWaylandBackend *backend); void updateSize(const QSize &size); + void updateMode(); private: WaylandOutput *m_waylandOutput; diff --git a/plugins/platforms/wayland/wayland_backend.cpp b/plugins/platforms/wayland/wayland_backend.cpp index d16b1afeb7..804dc8c9d4 100644 --- a/plugins/platforms/wayland/wayland_backend.cpp +++ b/plugins/platforms/wayland/wayland_backend.cpp @@ -452,6 +452,7 @@ WaylandBackend::WaylandBackend(QObject *parent) , m_connectionThread(nullptr) { connect(this, &WaylandBackend::connectionFailed, this, &WaylandBackend::initFailed); + supportsOutputChanges(); } WaylandBackend::~WaylandBackend()