mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
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:
parent
baac824ee3
commit
3323127db0
Notes:
sideshowbarker
2024-07-17 22:09:47 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/3323127db0 Pull-request: https://github.com/SerenityOS/serenity/pull/17779 Reviewed-by: https://github.com/gmta ✅
1 changed files with 4 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue