Skip to content

Commit 362b391

Browse files
theonlyasdktimschumi
authored andcommitted
LibGUI: Prevent repeated entries into panning mode
1 parent cd855f7 commit 362b391

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Userland/Libraries/LibGUI/AbstractZoomPanWidget.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Copyright (c) 2022, Mustafa Quraish <[email protected]>
33
* Copyright (c) 2022, Jelle Raaijmakers <[email protected]>
4+
* Copyright (c) 2025, TheOnlyASDK <[email protected]>
45
*
56
* SPDX-License-Identifier: BSD-2-Clause
67
*/
@@ -53,6 +54,12 @@ void AbstractZoomPanWidget::scale_centered(float new_scale, Gfx::IntPoint center
5354

5455
void AbstractZoomPanWidget::start_panning(Gfx::IntPoint position)
5556
{
57+
// FIXME: Keyboard events are repeated like in a text input field
58+
// thus needing for the following check as start_panning might get
59+
// called more than one time.
60+
if (m_is_panning)
61+
return;
62+
5663
m_saved_cursor = override_cursor();
5764
set_override_cursor(Gfx::StandardCursor::Drag);
5865
m_pan_start = m_origin;

0 commit comments

Comments
 (0)