XdgTopLevelWindow: Translate window menu coordinate from local

The show_window_menu request is in surface-local coordinates,
which include any client-side window shadows.

Translate the menu coordinates so the window shows up in the
right spot.
This commit is contained in:
Kai Uwe Broulik 2023-08-09 17:03:50 +02:00
parent 9ecd378624
commit ed8b581dda

View file

@ -925,7 +925,7 @@ void XdgToplevelWindow::handleWindowClassChanged()
void XdgToplevelWindow::handleWindowMenuRequested(SeatInterface *seat, const QPoint &surfacePos, void XdgToplevelWindow::handleWindowMenuRequested(SeatInterface *seat, const QPoint &surfacePos,
quint32 serial) quint32 serial)
{ {
performMouseCommand(Options::MouseOperationsMenu, pos() + surfacePos); performMouseCommand(Options::MouseOperationsMenu, mapFromLocal(surfacePos));
} }
void XdgToplevelWindow::handleMoveRequested(SeatInterface *seat, quint32 serial) void XdgToplevelWindow::handleMoveRequested(SeatInterface *seat, quint32 serial)