diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2022-08-26 11:49:13 -0400 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-08-28 16:04:35 +0100 |
commit | 38e13772e0c0b864736e3da419d8792b39eebdc2 (patch) | |
tree | 1355d3e6c3d8c9b8cfd7ed24e206d577b4b92f2c | |
parent | e22311370beeb5f56e466c52709ff486e0e9f7a8 (diff) | |
download | serenity-38e13772e0c0b864736e3da419d8792b39eebdc2.zip |
LibGUI: Make CommandPalette and EmojiInputDialog passive modals
Now they can be dismissed by clicking anywhere outside themselves,
including on their parent windows. This is a better default for
them since they don't have title bars to flash, and it's more
consistent with other frameless windows in the system.
-rw-r--r-- | Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp b/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp index aed5f8ffcb..88fb2db309 100644 --- a/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp +++ b/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp @@ -195,6 +195,7 @@ void ConnectionToWindowServer::key_down(i32 window_id, u32 code_point, u32 key, bool focused_widget_accepts_emoji_input = window->focused_widget() && window->focused_widget()->accepts_emoji_input(); if (focused_widget_accepts_emoji_input && (modifiers == (Mod_Ctrl | Mod_Alt)) && key == Key_Space) { auto emoji_input_dialog = EmojiInputDialog::construct(window); + emoji_input_dialog->set_window_mode(GUI::WindowMode::Passive); if (emoji_input_dialog->exec() != EmojiInputDialog::ExecResult::OK) return; key_event->m_key = Key_Invalid; @@ -213,6 +214,7 @@ void ConnectionToWindowServer::key_down(i32 window_id, u32 code_point, u32 key, // FIXME: This shortcut should be configurable. if (accepts_command_palette && !m_in_command_palette && modifiers == (Mod_Ctrl | Mod_Shift) && key == Key_A) { auto command_palette = CommandPalette::construct(*window); + command_palette->set_window_mode(GUI::WindowMode::Passive); TemporaryChange change { m_in_command_palette, true }; if (command_palette->exec() != GUI::Dialog::ExecResult::OK) return; |