From 3662c75a533fa49860533356ed80b3d4d9e0f252 Mon Sep 17 00:00:00 2001 From: Nathan Garside Date: Sat, 11 Nov 2023 09:49:11 +0000 Subject: [PATCH] tiling: update ui on shift press/release --- src/input.cpp | 8 ++++---- src/moving_client_x11_filter.cpp | 14 +++++++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index 7eb9c3bd0b..814040926b 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -642,10 +642,10 @@ public: } if (event->type() == QEvent::KeyPress) { window->keyPressEvent(event->key() | event->modifiers()); - if (window->isInteractiveMove() || window->isInteractiveResize()) { - // only update if mode didn't end - window->updateInteractiveMoveResize(input()->globalPointer()); - } + } + if (window->isInteractiveMove() || window->isInteractiveResize()) { + // only update if mode didn't end + window->updateInteractiveMoveResize(input()->globalPointer()); } return true; } diff --git a/src/moving_client_x11_filter.cpp b/src/moving_client_x11_filter.cpp index f0e88489f8..3f5aea2c0c 100644 --- a/src/moving_client_x11_filter.cpp +++ b/src/moving_client_x11_filter.cpp @@ -16,7 +16,7 @@ namespace KWin { MovingClientX11Filter::MovingClientX11Filter() - : X11EventFilter(QList{XCB_KEY_PRESS, XCB_MOTION_NOTIFY, XCB_BUTTON_PRESS, XCB_BUTTON_RELEASE}) + : X11EventFilter(QList{XCB_KEY_PRESS, XCB_KEY_RELEASE, XCB_MOTION_NOTIFY, XCB_BUTTON_PRESS, XCB_BUTTON_RELEASE}) { } @@ -37,6 +37,18 @@ bool MovingClientX11Filter::event(xcb_generic_event_t *event) xcb_key_press_event_t *keyEvent = reinterpret_cast(event); KKeyServer::xcbKeyPressEventToQt(keyEvent, &keyQt); client->keyPressEvent(keyQt, keyEvent->time); + if (client->isInteractiveMove() || client->isInteractiveResize()) { + const QPointF global = QPointF(Xcb::fromXNative(keyEvent->root_x), Xcb::fromXNative(keyEvent->root_y)); + client->updateInteractiveMoveResize(global); + } + return true; + } + case XCB_KEY_RELEASE: { + if (client->isInteractiveMove() || client->isInteractiveResize()) { + auto *keyEvent = reinterpret_cast(event); + const QPointF global = QPointF(Xcb::fromXNative(keyEvent->root_x), Xcb::fromXNative(keyEvent->root_y)); + client->updateInteractiveMoveResize(global); + } return true; } case XCB_BUTTON_PRESS: