Blame SOURCES/0041-Client-set-constraint-adjustments-for-popups-in-xdg.patch

e1c9ed
From 48b9dbb4d9d508895f7568531d8f0a7e63261b75 Mon Sep 17 00:00:00 2001
e1c9ed
From: Liang Qi <liang.qi@qt.io>
e1c9ed
Date: Tue, 4 Jan 2022 12:30:36 +0100
e1c9ed
Subject: [PATCH] client: set_constraint_adjustment() for popups in xdg
e1c9ed
e1c9ed
See also https://cgit.freedesktop.org/wayland/wayland-protocols/tree/stable/xdg-shell/xdg-shell.xml#n234 .
e1c9ed
e1c9ed
Kudos to Greg V for his original patch in jira.
e1c9ed
e1c9ed
Fixes: QTBUG-87303
e1c9ed
Pick-to: 5.15 6.2 6.3
e1c9ed
Done-with: Greg V <greg@unrelenting.technology>
e1c9ed
Change-Id: I57df9aedea7cc6f0b6fa142a6fc6c3bdc98324c8
e1c9ed
Reviewed-by: David Edmundson <davidedmundson@kde.org>
e1c9ed
(cherry picked from commit 59a5fe99e1569421b920d99c5b20cdafcdcf43a9)
e1c9ed
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
e1c9ed
index 1c76294..3b99c4b 100644
e1c9ed
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
e1c9ed
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
e1c9ed
@@ -410,6 +410,13 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent)
e1c9ed
     positioner->set_anchor(QtWayland::xdg_positioner::anchor_top_left);
e1c9ed
     positioner->set_gravity(QtWayland::xdg_positioner::gravity_bottom_right);
e1c9ed
     positioner->set_size(m_window->geometry().width(), m_window->geometry().height());
e1c9ed
+    const QByteArray currentDesktop = qgetenv("XDG_CURRENT_DESKTOP");
e1c9ed
+    if (currentDesktop != QByteArray("KDE")) {
e1c9ed
+        positioner->set_constraint_adjustment(QtWayland::xdg_positioner::constraint_adjustment_slide_x
e1c9ed
+            | QtWayland::xdg_positioner::constraint_adjustment_slide_y
e1c9ed
+            | QtWayland::xdg_positioner::constraint_adjustment_flip_x
e1c9ed
+            | QtWayland::xdg_positioner::constraint_adjustment_flip_y);
e1c9ed
+    }
e1c9ed
     m_popup = new Popup(this, parentXdgSurface, positioner);
e1c9ed
     positioner->destroy();
e1c9ed
     delete positioner;