From c99693ec30db5c80847b496ee792a3b22273bfc1 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Tue, 1 Nov 2022 08:31:20 +0100 Subject: [PATCH] Remove already upstreamed patches --- ...in-the-top-left-corner-of-the-screen.patch | 89 ------------------- ...ows-into-account-when-placing-popups.patch | 28 ------ qt6-qtwayland.spec | 2 - 3 files changed, 119 deletions(-) delete mode 100644 0100-Keep-toplevel-windows-in-the-top-left-corner-of-the-screen.patch delete mode 100644 0101-client-do-not-take-decoration-shadows-into-account-when-placing-popups.patch diff --git a/0100-Keep-toplevel-windows-in-the-top-left-corner-of-the-screen.patch b/0100-Keep-toplevel-windows-in-the-top-left-corner-of-the-screen.patch deleted file mode 100644 index 6a3f6e7..0000000 --- a/0100-Keep-toplevel-windows-in-the-top-left-corner-of-the-screen.patch +++ /dev/null @@ -1,89 +0,0 @@ -From de46b3c6d1bef4b8f64c7db7069c8fd33ef23ed9 Mon Sep 17 00:00:00 2001 -From: David Redondo -Date: Wed, 8 Jun 2022 11:25:59 +0200 -Subject: [PATCH] Keep toplevel windows in the top left corner of the screen - -Cherry-picked from commit a46795a2. Fixes https://bugs.kde.org/show_bug.cgi?id=436016 ------------------------------------------------------------------------- -We can't know the actual position of a window on the screen. This causes -an issue when Widgets try to position a popup/menu absolutely and keep -it on the screen when the screen geometry doesn't include (0,0). -Instead report their positions always as the top left corner of -the screen that they are on. -This new behavior can be disabled for qt-shell or via an environment -variable by users that rely on the old behavior. - -Fixes: QTBUG-85297 -Change-Id: Iacb91cb03a0df87af950115760d2f41124ac06a3 -Reviewed-by: Qt CI Bot -Reviewed-by: David Edmundson -Reviewed-by: Aleix Pol Gonzalez ---- - src/client/qwaylandintegration.cpp | 4 ++++ - src/client/qwaylandwindow.cpp | 14 +++++++++++++- - src/client/qwaylandwindow_p.h | 3 +++ - 3 files changed, 20 insertions(+), 1 deletion(-) - -diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp -index 2bf5fa4..823049c 100644 ---- a/src/client/qwaylandintegration.cpp -+++ b/src/client/qwaylandintegration.cpp -@@ -122,6 +122,9 @@ QWaylandIntegration::QWaylandIntegration() - return; - } - -+ QWaylandWindow::fixedToplevelPositions = -+ !qEnvironmentVariableIsSet("QT_WAYLAND_DISABLE_FIXED_POSITIONS"); -+ - // ### Not ideal... - // We don't want to use QPlatformWindow::requestActivate here, since that gives a warning - // for most shells. Also, we don't want to put this into the specific shells that can use -diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp -index 5161604..d57e9ed 100644 ---- a/src/client/qwaylandwindow.cpp -+++ b/src/client/qwaylandwindow.cpp -@@ -364,8 +364,13 @@ void QWaylandWindow::setGeometry_helper(const QRect &rect) - } - } - --void QWaylandWindow::setGeometry(const QRect &rect) -+void QWaylandWindow::setGeometry(const QRect &r) - { -+ auto rect = r; -+ if (fixedToplevelPositions && !QPlatformWindow::parent() && window()->type() != Qt::Popup -+ && window()->type() != Qt::ToolTip) { -+ rect.moveTo(screen()->geometry().topLeft()); -+ } - setGeometry_helper(rect); - - if (window()->isVisible() && rect.isValid()) { -@@ -1242,6 +1247,13 @@ void QWaylandWindow::handleScreensChanged() - - QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->QPlatformScreen::screen()); - mLastReportedScreen = newScreen; -+ if (fixedToplevelPositions && !QPlatformWindow::parent() && window()->type() != Qt::Popup -+ && window()->type() != Qt::ToolTip -+ && geometry().topLeft() != newScreen->geometry().topLeft()) { -+ auto geometry = this->geometry(); -+ geometry.moveTo(newScreen->geometry().topLeft()); -+ setGeometry(geometry); -+ } - - int scale = newScreen->isPlaceholder() ? 1 : static_cast(newScreen)->scale(); - if (scale != mScale) { -diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h -index 28f780b..53344fc 100644 ---- a/src/client/qwaylandwindow_p.h -+++ b/src/client/qwaylandwindow_p.h -@@ -110,6 +110,9 @@ public: - QWaylandWindow(QWindow *window, QWaylandDisplay *display); - ~QWaylandWindow() override; - -+ // Keep Toplevels position on the top left corner of their screen -+ static inline bool fixedToplevelPositions = true; -+ - virtual WindowType windowType() const = 0; - virtual void ensureSize(); - WId winId() const override; --- -GitLab diff --git a/0101-client-do-not-take-decoration-shadows-into-account-when-placing-popups.patch b/0101-client-do-not-take-decoration-shadows-into-account-when-placing-popups.patch deleted file mode 100644 index aa6464e..0000000 --- a/0101-client-do-not-take-decoration-shadows-into-account-when-placing-popups.patch +++ /dev/null @@ -1,28 +0,0 @@ -From a4a41fdb2d116f15d7cec4c3fe9d23ef16deb1aa Mon Sep 17 00:00:00 2001 -From: Jan Grulich -Date: Fri, 29 Jul 2022 11:47:02 +0200 -Subject: [PATCH] Client: do not take decoration shadows into account when placing popups - -The anchor rectangle is relative to the window geometry, which according -to xdg-shell specs shouldn't include invisible portions like shadows. -This causes all popups be wrongly positioned when drop-shadows are used. - -Pick-to: 6.4 6.3 6.2 -Change-Id: Iac30ab264599f9898f3ddecd7f0c5f2aca824ad6 ---- - -diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp -index e3dee44..c4b1942 100644 ---- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp -+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp -@@ -410,8 +410,8 @@ - QPoint transientPos = m_window->geometry().topLeft(); // this is absolute - transientPos -= parent->geometry().topLeft(); - if (parent->decoration()) { -- transientPos.setX(transientPos.x() + parent->decoration()->margins().left()); -- transientPos.setY(transientPos.y() + parent->decoration()->margins().top()); -+ transientPos.setX(transientPos.x() + parent->decoration()->margins(QWaylandAbstractDecoration::ShadowsExcluded).left()); -+ transientPos.setY(transientPos.y() + parent->decoration()->margins(QWaylandAbstractDecoration::ShadowsExcluded).top()); - } - positioner->set_anchor_rect(transientPos.x(), transientPos.y(), 1, 1); - positioner->set_anchor(QtWayland::xdg_positioner::anchor_top_left); diff --git a/qt6-qtwayland.spec b/qt6-qtwayland.spec index 9de1a18..53cd7c5 100644 --- a/qt6-qtwayland.spec +++ b/qt6-qtwayland.spec @@ -25,8 +25,6 @@ Source0: https://download.qt.io/official_releases/qt/%{majmin}/%{version}/submod %endif # Upstream patches -Patch100: 0100-Keep-toplevel-windows-in-the-top-left-corner-of-the-screen.patch -Patch101: 0101-client-do-not-take-decoration-shadows-into-account-when-placing-popups.patch # Upstreamable patches