mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 17:15:06 +00:00
WindowServer: Switch current menu if hovering over another menu with button.
This commit is contained in:
parent
145aa27b8f
commit
6dd1a1f26d
1 changed files with 4 additions and 2 deletions
|
@ -379,8 +379,10 @@ void WSWindowManager::notify_rect_changed(WSWindow& window, const Rect& old_rect
|
|||
|
||||
void WSWindowManager::handle_menu_mouse_event(WSMenu& menu, WSMouseEvent& event)
|
||||
{
|
||||
if (event.type() == WSMouseEvent::MouseDown && event.button() == MouseButton::Left) {
|
||||
dbgprintf("[WM] MouseDown on menu '%s'\n", menu.name().characters());
|
||||
bool should_open_menu = (event.type() == WSMouseEvent::MouseMove && event.buttons() & (unsigned)MouseButton::Left)
|
||||
|| (event.type() == WSMouseEvent::MouseDown && event.button() == MouseButton::Left);
|
||||
|
||||
if (should_open_menu) {
|
||||
if (m_current_menu == &menu)
|
||||
return;
|
||||
close_current_menu();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue