mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:37:35 +00:00
LibGUI: Fix issue where buttons with a menu sometimes stayed depressed
When a Button has a menu, the AbstractButton behaviour will now not be used in the mousemove_event. This was already the case for mousedown_event. Why only sometimes? Normally the presence of the menu prevents mousemove_events from being delivered to the button. But the menu doesn't spawn immediately. So sometimes mousemove events got through to the AbstractButton after the menu was told to spawn but before it appeared. This caused the m_being_pressed field of AbstractButton to be set to true. But there was never a mouseup_event because the menu got those instead.
This commit is contained in:
parent
da72c6987f
commit
d96aae32ef
2 changed files with 9 additions and 0 deletions
|
@ -174,4 +174,12 @@ void Button::mousedown_event(MouseEvent& event)
|
|||
AbstractButton::mousedown_event(event);
|
||||
}
|
||||
|
||||
void Button::mousemove_event(MouseEvent& event)
|
||||
{
|
||||
if (m_menu) {
|
||||
return;
|
||||
}
|
||||
AbstractButton::mousemove_event(event);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue