Skip to content

Commit 12ee920

Browse files
thankyouverycoollinusg
authored andcommitted
LibGUI+Taskbar: Don't immediately repaint checkable Buttons
Unlike regular buttons, unchecked checkables don't need to repaint on MouseUp to feel responsive when clicking rapidly. In fact, this can lead to a flickering effect when a bogus unchecked state gets painted again before the button's checked one.
1 parent 56a719d commit 12ee920

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Userland/Libraries/LibGUI/AbstractButton.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ void AbstractButton::mouseup_event(MouseEvent& event)
134134
bool was_being_pressed = m_being_pressed;
135135
m_being_pressed = false;
136136
m_pressed_mouse_button = MouseButton::None;
137-
repaint();
137+
if (!is_checkable() || is_checked())
138+
repaint();
138139
if (was_being_pressed && !was_auto_repeating) {
139140
switch (event.button()) {
140141
case MouseButton::Primary:

0 commit comments

Comments
 (0)