Paste P416

Masterwork From Distant Lands
ActivePublic

Authored by davidedmundson on Jun 21 2019, 5:57 PM.
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
index f5529813..957db33e 100644
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
@@ -217,6 +217,13 @@ QWaylandXdgSurface::Popup::~Popup()
}
}
+void QWaylandXdgSurface::Popup::applyConfigure()
+{
+ if (m_pending.size != m_applied.size)
+ m_xdgSurface->m_window->resizeFromApplyConfigure(m_pending.size);
+ m_applied = m_pending;
+}
+
void QWaylandXdgSurface::Popup::grab(QWaylandInputDevice *seat, uint serial)
{
m_xdgSurface->m_shell->m_topmostGrabbingPopup = this;
@@ -229,6 +236,13 @@ void QWaylandXdgSurface::Popup::xdg_popup_popup_done()
m_xdgSurface->m_window->window()->close();
}
+void QWaylandXdgSurface::xdg_popup_popup_configure(int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ m_pending.size = QSize(width, height);
+}
+
+
+
QWaylandXdgSurface::QWaylandXdgSurface(QWaylandXdgShell *shell, ::xdg_surface *surface, QWaylandWindow *window)
: QWaylandShellSurface(window)
, xdg_surface(surface)
@@ -330,6 +344,9 @@ void QWaylandXdgSurface::applyConfigure()
if (m_toplevel)
m_toplevel->applyConfigure();
+ else if (m_popup) {
+ m_popup->applyConfigure();
+ }
m_configured = true;
ack_configure(m_pendingConfigureSerial);
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
index 8f8682a4..c67f44cd 100644
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
@@ -133,13 +133,19 @@ private:
public:
Popup(QWaylandXdgSurface *xdgSurface, QWaylandXdgSurface *parent, QtWayland::xdg_positioner *positioner);
~Popup() override;
+ void applyConfigure();
void grab(QWaylandInputDevice *seat, uint serial);
+ void xdg_popup_popup_configure(int32_t x, int32_t y, int32_t width, int32_t height);
void xdg_popup_popup_done() override;
QWaylandXdgSurface *m_xdgSurface = nullptr;
QWaylandXdgSurface *m_parent = nullptr;
bool m_grabbing = false;
+
+ struct {
+ QSize size = {0, 0};
+ } m_pending, m_applied;
};
void setToplevel();
davidedmundson edited the content of this paste. (Show Details)Jun 21 2019, 5:57 PM
davidedmundson changed the title of this paste from untitled to Masterwork From Distant Lands.