diff options
Diffstat (limited to 'src/plugins')
7 files changed, 32 insertions, 0 deletions
diff --git a/src/plugins/decorations/bradient/main.cpp b/src/plugins/decorations/bradient/main.cpp index 83dc8604b..1bf67bbc3 100644 --- a/src/plugins/decorations/bradient/main.cpp +++ b/src/plugins/decorations/bradient/main.cpp @@ -333,6 +333,8 @@ void QWaylandBradientDecoration::processMouseTop(QWaylandInputDevice *inputDevic processMouseLeft(inputDevice, local, b, mods); } else if (local.x() > window()->width() + margins().left()) { processMouseRight(inputDevice, local, b, mods); + } else if (isRightClicked(b)) { + showWindowMenu(inputDevice); } else if (closeButtonRect().contains(local)) { if (clickButton(b, Close)) QWindowSystemInterface::handleCloseEvent(window()); diff --git a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp index b691ee747..e9f64e2e6 100644 --- a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp +++ b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp @@ -95,6 +95,13 @@ bool QWaylandXdgSurfaceV5::move(QWaylandInputDevice *inputDevice) return true; } +bool QWaylandXdgSurfaceV5::showWindowMenu(QWaylandInputDevice *seat) +{ + QPoint position = seat->pointerSurfacePosition().toPoint(); + show_window_menu(seat->wl_seat(), seat->serial(), position.x(), position.y()); + return true; +} + void QWaylandXdgSurfaceV5::updateTransientParent(QWaylandWindow *parent) { if (!parent) diff --git a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5_p.h b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5_p.h index 231a56d84..feebee7f4 100644 --- a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5_p.h +++ b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5_p.h @@ -84,6 +84,7 @@ public: using QtWayland::xdg_surface_v5::move; bool move(QWaylandInputDevice *inputDevice) override; + bool showWindowMenu(QWaylandInputDevice *seat) override; void setTitle(const QString &title) override; void setAppId(const QString &appId) override; diff --git a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp index e12573ad0..01122769e 100644 --- a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp +++ b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp @@ -251,6 +251,16 @@ bool QWaylandXdgSurfaceV6::move(QWaylandInputDevice *inputDevice) return false; } +bool QWaylandXdgSurfaceV6::showWindowMenu(QWaylandInputDevice *seat) +{ + if (m_toplevel && m_toplevel->isInitialized()) { + QPoint position = seat->pointerSurfacePosition().toPoint(); + m_toplevel->show_window_menu(seat->wl_seat(), seat->serial(), position.x(), position.y()); + return true; + } + return false; +} + void QWaylandXdgSurfaceV6::setTitle(const QString &title) { if (m_toplevel) diff --git a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h index 5a2867379..e688f751a 100644 --- a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h +++ b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h @@ -79,6 +79,7 @@ public: void resize(QWaylandInputDevice *inputDevice, Qt::Edges edges) override; bool move(QWaylandInputDevice *inputDevice) override; + bool showWindowMenu(QWaylandInputDevice *seat) override; void setTitle(const QString &title) override; void setAppId(const QString &appId) override; diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp index 8759cb8c9..cabba5b3b 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -279,6 +279,16 @@ bool QWaylandXdgSurface::move(QWaylandInputDevice *inputDevice) return false; } +bool QWaylandXdgSurface::showWindowMenu(QWaylandInputDevice *seat) +{ + if (m_toplevel && m_toplevel->isInitialized()) { + QPoint position = seat->pointerSurfacePosition().toPoint(); + m_toplevel->show_window_menu(seat->wl_seat(), seat->serial(), position.x(), position.y()); + return true; + } + return false; +} + void QWaylandXdgSurface::setTitle(const QString &title) { if (m_toplevel) diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h index 1dc1def23..416feee2c 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h @@ -82,6 +82,7 @@ public: void resize(QWaylandInputDevice *inputDevice, Qt::Edges edges) override; bool move(QWaylandInputDevice *inputDevice) override; + bool showWindowMenu(QWaylandInputDevice *seat) override; void setTitle(const QString &title) override; void setAppId(const QString &appId) override; void setWindowFlags(Qt::WindowFlags flags) override; |