mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 03:37:53 +00:00
LibGUI: Allow GUI::Action to swallow key events when disabled
Sometimes an action should be disabled and the KeyEvent not posted to
the app's event loop nonetheless. In other words the action swallows the
KeyEvent without being activated.
Specific use-case: Terminal's Ctrl+Shift+{C,V}.
This commit is contained in:
committed by
Andreas Kling
parent
253aa7aa7d
commit
886fe7e69f
@@ -173,9 +173,13 @@ void WindowServerConnection::handle(const Messages::WindowClient::KeyDown& messa
|
||||
#endif
|
||||
}
|
||||
|
||||
if (action && action->is_enabled()) {
|
||||
action->activate();
|
||||
return;
|
||||
if (action) {
|
||||
if (action->is_enabled()) {
|
||||
action->activate();
|
||||
return;
|
||||
}
|
||||
if (action->swallow_key_event_when_disabled())
|
||||
return;
|
||||
}
|
||||
|
||||
bool focused_widget_accepts_emoji_input = window->focused_widget() && window->focused_widget()->accepts_emoji_input();
|
||||
|
||||
Reference in New Issue
Block a user