tiling: update ui on shift press/release

This commit is contained in:
Nathan Garside 2023-11-11 09:49:11 +00:00 committed by Vlad Zahorodnii
parent b8fb43db95
commit 3662c75a53
2 changed files with 17 additions and 5 deletions

View file

@ -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;
}

View file

@ -16,7 +16,7 @@ namespace KWin
{
MovingClientX11Filter::MovingClientX11Filter()
: X11EventFilter(QList<int>{XCB_KEY_PRESS, XCB_MOTION_NOTIFY, XCB_BUTTON_PRESS, XCB_BUTTON_RELEASE})
: X11EventFilter(QList<int>{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<xcb_key_press_event_t *>(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<xcb_key_release_event_t *>(event);
const QPointF global = QPointF(Xcb::fromXNative(keyEvent->root_x), Xcb::fromXNative(keyEvent->root_y));
client->updateInteractiveMoveResize(global);
}
return true;
}
case XCB_BUTTON_PRESS: