LibGUI: Allow blocking modals and popups to handle their own shortcuts

Since ef7d9c0, shortcut propagation was blocked for blocking modals and
popups. This however is an issue as some blocking modals (like
FilePicker) use shortcuts. This patch allows propagation of shortcuts
but only until the current window.
This commit is contained in:
Lucas CHOLLET 2023-03-15 19:45:21 -04:00 committed by Jelle Raaijmakers
parent baac824ee3
commit 3323127db0
Notes: sideshowbarker 2024-07-17 22:09:47 +09:00

View file

@ -528,12 +528,11 @@ void Window::handle_key_event(KeyEvent& event)
if (event.is_accepted())
return;
if (is_blocking() || is_popup())
return;
// Only process shortcuts if this is a keydown event.
if (event.type() == Event::KeyDown)
propagate_shortcuts(event, nullptr, PropagationLimit::Application);
if (event.type() == Event::KeyDown) {
auto const boundary = (is_blocking() || is_popup()) ? ShortcutPropagationBoundary::Window : ShortcutPropagationBoundary::Application;
propagate_shortcuts(event, nullptr, boundary);
}
}
void Window::handle_resize_event(ResizeEvent& event)