From c4e090aa9a8bdb889a1cb76589fe5c09c01c8399 Mon Sep 17 00:00:00 2001 From: askmeaboutloom Date: Sun, 10 Nov 2024 05:03:35 +0100 Subject: [PATCH] Make canvas not eat key presses and releases It steals them from the main window's tool switch functionality, causing temporary tool switches to stop working. --- ChangeLog | 1 + src/desktop/scene/canvasview.cpp | 2 -- src/desktop/view/canvascontroller.cpp | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f0bd06ae32..187ea52bbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ Unreleased Version 2.2.2-pre * Feature: Color circle dock with gamut masks, available through View > Docks > Color Circle. Similar to Krita's Artistic Color Selector and MyPaint's HSV/HCY Wheel. + * Fix: Make temporary tool switches by holding a key down work again. Thanks 3rd_EFNO and bunnie for reporting. 2024-11-06 Version 2.2.2-beta.4 * Fix: Solve rendering glitches with selection outlines that happen on some systems. Thanks xxxx for reporting. diff --git a/src/desktop/scene/canvasview.cpp b/src/desktop/scene/canvasview.cpp index de67ba7eb6..bb5546d28d 100644 --- a/src/desktop/scene/canvasview.cpp +++ b/src/desktop/scene/canvasview.cpp @@ -1541,7 +1541,6 @@ void CanvasView::keyPressEvent(QKeyEvent *event) return; } - event->accept(); m_keysDown.insert(Qt::Key(event->key())); if(m_dragmode == ViewDragMode::Started && m_dragButton != Qt::NoButton) { @@ -1652,7 +1651,6 @@ void CanvasView::keyReleaseEvent(QKeyEvent *event) return; } - event->accept(); bool wasDragging = m_dragmode == ViewDragMode::Started; if(wasDragging) { CanvasShortcuts::Match dragMatch = diff --git a/src/desktop/view/canvascontroller.cpp b/src/desktop/view/canvascontroller.cpp index bc45f7fd72..fa19dd1cc2 100644 --- a/src/desktop/view/canvascontroller.cpp +++ b/src/desktop/view/canvascontroller.cpp @@ -766,7 +766,6 @@ void CanvasController::handleKeyPress(QKeyEvent *event) return; } - event->accept(); m_keysDown.insert(Qt::Key(key)); Qt::KeyboardModifiers modifiers = getKeyboardModifiers(event); @@ -879,7 +878,6 @@ void CanvasController::handleKeyRelease(QKeyEvent *event) return; } - event->accept(); bool wasDragging = m_dragMode == ViewDragMode::Started; if(wasDragging) { CanvasShortcuts::Match dragMatch =