From fe85af256092e3b839323fa14633e77c7f1e3161 Mon Sep 17 00:00:00 2001 From: Karliss Date: Thu, 9 Nov 2023 21:55:52 +0200 Subject: [PATCH] Remove unnessary mouse grab. * Causes warning spam with Qt wayland backend * Can sometimes cause crash on wayland * According to docs shouldn't be necesarry --- src/widgets/ColorPicker.cpp | 2 -- src/widgets/GraphView.cpp | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/widgets/ColorPicker.cpp b/src/widgets/ColorPicker.cpp index e35f1c5ffb..1733a74ae8 100644 --- a/src/widgets/ColorPicker.cpp +++ b/src/widgets/ColorPicker.cpp @@ -286,7 +286,6 @@ void ColorPicker::startPickingFromScreen() { if (!pickingFromScreen) { setMouseTracking(true); - grabMouse(Qt::CursorShape::CrossCursor); pickingFromScreen = true; bufferColor = currColor; } @@ -298,7 +297,6 @@ void ColorPicker::mouseReleaseEvent(QMouseEvent *event) setColor(getColorAtMouse()); pickingFromScreen = false; setMouseTracking(false); - releaseMouse(); } QWidget::mouseReleaseEvent(event); } diff --git a/src/widgets/GraphView.cpp b/src/widgets/GraphView.cpp index 9fcca211ca..a5e276ed1f 100644 --- a/src/widgets/GraphView.cpp +++ b/src/widgets/GraphView.cpp @@ -159,7 +159,6 @@ void GraphView::beginMouseDrag(QMouseEvent *event) scrollBase = event->pos(); scroll_mode = true; setCursor(Qt::ClosedHandCursor); - viewport()->grabMouse(); } void GraphView::setViewOffset(QPoint offset) @@ -741,7 +740,6 @@ void GraphView::mouseReleaseEvent(QMouseEvent *event) if (scroll_mode && (event->buttons() & (Qt::LeftButton | Qt::MiddleButton)) == 0) { scroll_mode = false; setCursor(Qt::ArrowCursor); - viewport()->releaseMouse(); } }