Adapt to NETRootInfo::moveResize() changes

This commit is contained in:
Vlad Zahorodnii 2024-02-13 11:29:12 +02:00
parent eab90b6a0a
commit 8a9cb06b41
5 changed files with 7 additions and 7 deletions

View file

@ -576,7 +576,7 @@ void MoveResizeWindowTest::testNetMove()
// use NETRootInfo to trigger a move request
NETRootInfo root(c.get(), NET::Properties());
root.moveResizeRequest(windowId, origGeo.center().x(), origGeo.center().y(), NET::Move);
root.moveResizeRequest(windowId, origGeo.center().x(), origGeo.center().y(), NET::Move, XCB_BUTTON_INDEX_1);
xcb_flush(c.get());
QVERIFY(interactiveMoveResizeStartedSpy.wait());
@ -591,7 +591,7 @@ void MoveResizeWindowTest::testNetMove()
QCOMPARE(interactiveMoveResizeSteppedSpy.first().last(), origGeo.translated(10, 10));
// let's cancel the move resize again through the net API
root.moveResizeRequest(windowId, window->frameGeometry().center().x(), window->frameGeometry().center().y(), NET::MoveResizeCancel);
root.moveResizeRequest(windowId, window->frameGeometry().center().x(), window->frameGeometry().center().y(), NET::MoveResizeCancel, XCB_BUTTON_INDEX_1);
xcb_flush(c.get());
QVERIFY(interactiveMoveResizeFinishedSpy.wait());

View file

@ -1270,7 +1270,7 @@ void X11Window::focusOutEvent(xcb_focus_out_event_t *e)
}
// performs _NET_WM_MOVERESIZE
void X11Window::NETMoveResize(qreal x_root, qreal y_root, NET::Direction direction)
void X11Window::NETMoveResize(qreal x_root, qreal y_root, NET::Direction direction, xcb_button_t button)
{
if (direction == NET::Move) {
// move cursor to the provided position to prevent the window jumping there on first movement

View file

@ -198,12 +198,12 @@ void RootInfo::closeWindow(xcb_window_t w)
}
}
void RootInfo::moveResize(xcb_window_t w, int x_root, int y_root, unsigned long direction)
void RootInfo::moveResize(xcb_window_t w, int x_root, int y_root, unsigned long direction, xcb_button_t button, RequestSource source)
{
X11Window *c = Workspace::self()->findClient(Predicate::WindowMatch, w);
if (c) {
kwinApp()->updateXTime(); // otherwise grabbing may have old timestamp - this message should include timestamp
c->NETMoveResize(Xcb::fromXNative(x_root), Xcb::fromXNative(y_root), (Direction)direction);
c->NETMoveResize(Xcb::fromXNative(x_root), Xcb::fromXNative(y_root), (Direction)direction, button);
}
}

View file

@ -41,7 +41,7 @@ protected:
void changeCurrentDesktop(int d) override;
void changeActiveWindow(xcb_window_t w, NET::RequestSource src, xcb_timestamp_t timestamp, xcb_window_t active_window) override;
void closeWindow(xcb_window_t w) override;
void moveResize(xcb_window_t w, int x_root, int y_root, unsigned long direction) override;
void moveResize(xcb_window_t w, int x_root, int y_root, unsigned long direction, xcb_button_t button, RequestSource source) 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;

View file

@ -221,7 +221,7 @@ public:
QPointF gravityAdjustment(xcb_gravity_t gravity) const;
const QPointF calculateGravitation(bool invert) const;
void NETMoveResize(qreal x_root, qreal y_root, NET::Direction direction);
void NETMoveResize(qreal x_root, qreal y_root, NET::Direction direction, xcb_button_t button);
void NETMoveResizeWindow(int flags, qreal x, qreal y, qreal width, qreal height);
void GTKShowWindowMenu(qreal x_root, qreal y_root);
void restackWindow(xcb_window_t above, int detail, NET::RequestSource source, xcb_timestamp_t timestamp,