1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-19 11:22:08 +00:00

WindowServer: Various window pop-up menu fixes & QoL tweaks

This commit is contained in:
Jami Kettunen 2020-01-04 15:14:36 +02:00 committed by Andreas Kling
parent eab34a7de3
commit 74ae6ac94b
5 changed files with 74 additions and 9 deletions

View file

@ -883,8 +883,18 @@ void WSWindowManager::process_mouse_event(WSMouseEvent& event, WSWindow*& hovere
if (!event_is_inside_current_menu) {
if (topmost_menu->hovered_item())
topmost_menu->clear_hovered_item();
if (event.type() == WSEvent::MouseDown || event.type() == WSEvent::MouseUp)
if (event.type() == WSEvent::MouseDown || event.type() == WSEvent::MouseUp) {
auto* window_menu_of = topmost_menu->window_menu_of();
if (window_menu_of) {
bool event_is_inside_taskbar_button = window_menu_of->taskbar_rect().contains(event.position());
if (event_is_inside_taskbar_button && !topmost_menu->is_window_menu_open()) {
topmost_menu->set_window_menu_open(true);
return;
}
}
m_menu_manager.close_bar();
topmost_menu->set_window_menu_open(false);
}
if (event.type() == WSEvent::MouseMove) {
for (auto& menu : m_menu_manager.open_menu_stack()) {
if (!menu)