summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp23
-rw-r--r--src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h6
2 files changed, 29 insertions, 0 deletions
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
index ee53341a..cd6e835f 100644
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
@@ -243,6 +243,22 @@ QWaylandXdgSurface::Popup::~Popup()
}
}
+void QWaylandXdgSurface::Popup::applyConfigure()
+{
+ if (m_pendingGeometry.isValid()) {
+ QRect geometryWithMargins = m_pendingGeometry.marginsAdded(m_xdgSurface->m_window->windowContentMargins());
+ QMargins parentMargins = m_parent->windowContentMargins() - m_parent->clientSideMargins();
+ QRect globalGeometry = geometryWithMargins.translated(m_parent->geometry().topLeft() + QPoint(parentMargins.left(), parentMargins.top()));
+ m_xdgSurface->setGeometryFromApplyConfigure(globalGeometry.topLeft(), globalGeometry.size());
+ }
+ resetConfiguration();
+}
+
+void QWaylandXdgSurface::Popup::resetConfiguration()
+{
+ m_pendingGeometry = QRect();
+}
+
void QWaylandXdgSurface::Popup::grab(QWaylandInputDevice *seat, uint serial)
{
m_xdgSurface->m_shell->m_topmostGrabbingPopup = this;
@@ -250,6 +266,11 @@ void QWaylandXdgSurface::Popup::grab(QWaylandInputDevice *seat, uint serial)
m_grabbing = true;
}
+void QWaylandXdgSurface::Popup::xdg_popup_configure(int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ m_pendingGeometry = QRect(x, y, width, height);
+}
+
void QWaylandXdgSurface::Popup::xdg_popup_popup_done()
{
m_xdgSurface->m_window->window()->close();
@@ -364,6 +385,8 @@ void QWaylandXdgSurface::applyConfigure()
if (m_toplevel)
m_toplevel->applyConfigure();
+ if (m_popup)
+ m_popup->applyConfigure();
m_appliedConfigureSerial = m_pendingConfigureSerial;
m_configured = true;
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
index bf51888e..951e8234 100644
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
@@ -115,13 +115,19 @@ private:
Popup(QWaylandXdgSurface *xdgSurface, QWaylandWindow *parent, QtWayland::xdg_positioner *positioner);
~Popup() override;
+ void applyConfigure();
+ void resetConfiguration();
+
void grab(QWaylandInputDevice *seat, uint serial);
+ void xdg_popup_configure(int32_t x, int32_t y, int32_t width, int32_t height) override;
void xdg_popup_popup_done() override;
QWaylandXdgSurface *m_xdgSurface = nullptr;
QWaylandXdgSurface *m_parentXdgSurface = nullptr;
QWaylandWindow *m_parent = nullptr;
bool m_grabbing = false;
+
+ QRect m_pendingGeometry;
};
void setToplevel();