diff --git a/src/netinfo.cpp b/src/netinfo.cpp index 14cfbab23a..1b922a7124 100644 --- a/src/netinfo.cpp +++ b/src/netinfo.cpp @@ -100,7 +100,8 @@ RootInfo *RootInfo::create() | NET::WM2FullscreenMonitors | NET::WM2KDEShadow | NET::WM2OpaqueRegion - | NET::WM2GTKFrameExtents; + | NET::WM2GTKFrameExtents + | NET::WM2GTKShowWindowMenu; #if KWIN_BUILD_ACTIVITIES properties2 |= NET::WM2Activities; #endif @@ -216,6 +217,14 @@ void RootInfo::moveResizeWindow(xcb_window_t w, int flags, int x, int y, int wid } } +void RootInfo::showWindowMenu(xcb_window_t w, int device_id, int x_root, int y_root) +{ + Q_UNUSED(device_id); + if (X11Window *c = Workspace::self()->findClient(Predicate::WindowMatch, w)) { + c->GTKShowWindowMenu(x_root, y_root); + } +} + void RootInfo::gotPing(xcb_window_t w, xcb_timestamp_t timestamp) { if (X11Window *c = Workspace::self()->findClient(Predicate::WindowMatch, w)) { diff --git a/src/netinfo.h b/src/netinfo.h index 28d8e34122..5638f1d4ec 100644 --- a/src/netinfo.h +++ b/src/netinfo.h @@ -42,6 +42,7 @@ protected: void closeWindow(xcb_window_t w) override; void moveResize(xcb_window_t w, int x_root, int y_root, unsigned long direction) override; void moveResizeWindow(xcb_window_t w, int flags, int x, int y, int width, int height) override; + void showWindowMenu(xcb_window_t w, int device_id, int x_root, int y_root) override; void gotPing(xcb_window_t w, xcb_timestamp_t timestamp) override; void restackWindow(xcb_window_t w, RequestSource source, xcb_window_t above, int detail, xcb_timestamp_t timestamp) override; void changeShowingDesktop(bool showing) override; diff --git a/src/x11window.cpp b/src/x11window.cpp index 936f924a90..819850aa19 100644 --- a/src/x11window.cpp +++ b/src/x11window.cpp @@ -4077,6 +4077,13 @@ void X11Window::NETMoveResizeWindow(int flags, int x, int y, int width, int heig configureRequest(value_mask, x, y, width, height, gravity, true); } +// _GTK_SHOW_WINDOW_MENU +void X11Window::GTKShowWindowMenu(int x_root, int y_root) +{ + QPoint globalPos(x_root, y_root); + workspace()->showWindowMenu(QRect(globalPos, globalPos), this); +} + bool X11Window::isMovable() const { if (!hasNETSupport() && !m_motif.move()) { diff --git a/src/x11window.h b/src/x11window.h index ecc9308d2d..43e3f8cf43 100644 --- a/src/x11window.h +++ b/src/x11window.h @@ -236,6 +236,7 @@ public: void NETMoveResize(int x_root, int y_root, NET::Direction direction); void NETMoveResizeWindow(int flags, int x, int y, int width, int height); + void GTKShowWindowMenu(int x_root, int y_root); void restackWindow(xcb_window_t above, int detail, NET::RequestSource source, xcb_timestamp_t timestamp, bool send_event = false);