From 8b644fee5833205fc2c5f0a921cea4c33d4e3231 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 24 May 2022 10:45:15 +0300 Subject: [PATCH] backends/x11: Ensure that Output::geometryChanged is emitted when modes change BUG: 453696 Tested-by: Merge Service Part-of: --- src/backends/x11/standalone/x11_output.cpp | 7 +++++-- src/output.cpp | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/backends/x11/standalone/x11_output.cpp b/src/backends/x11/standalone/x11_output.cpp index 0c1c68d760..6e46c4d29c 100644 --- a/src/backends/x11/standalone/x11_output.cpp +++ b/src/backends/x11/standalone/x11_output.cpp @@ -64,8 +64,11 @@ bool X11Output::usesSoftwareCursor() const void X11Output::setMode(const QSize &size, int refreshRate) { - auto mode = QSharedPointer::create(size, refreshRate); - setModesInternal({mode}, mode); + const auto current = currentMode(); + if (!current || current->size() != size || current->refreshRate() != refreshRate) { + auto mode = QSharedPointer::create(size, refreshRate); + setModesInternal({mode}, mode); + } } } diff --git a/src/output.cpp b/src/output.cpp index 5f0f2cbb80..6c415b9f72 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -220,6 +220,7 @@ void Output::setModesInternal(const QList> &modes, co } if (m_currentMode != oldCurrentMode) { Q_EMIT currentModeChanged(); + Q_EMIT geometryChanged(); } }