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