1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 21:58:10 +00:00

WindowServer: Add accessory windows

Accessory windows are windows that, when activated, will activate
their parent and bring all other accessory windows of that parent
to the front of the window stack. Accessory windows can only be
active input windows. The accessory window's parent is always the
active window regardless of whether it is also the active input
window.

In order to route input correctly, input is now sent to the active
input window, which can be any accessory window or their parent,
or any regular window.
This commit is contained in:
Tom 2020-07-14 19:17:00 -06:00 committed by Andreas Kling
parent 396291b356
commit ec3737510d
16 changed files with 216 additions and 59 deletions

View file

@ -99,8 +99,17 @@ ComboBox::ComboBox()
open();
};
m_list_window = add<Window>();
m_list_window = add<Window>(window());
m_list_window->set_frameless(true);
m_list_window->set_accessory(true);
m_list_window->on_active_input_change = [this](bool is_active_input) {
if (!is_active_input) {
m_open_button->set_enabled(true);
close();
}
};
m_list_window->on_activity_change = [this](const bool is_active) {
if (!is_active) {
m_open_button->set_enabled(false);