1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:37:35 +00:00

LibGUI+WindowServer+Apps: Replace Accessory Windows

with the CaptureInput WindowMode. This mode will serve the same
function as accessories: redirecting input while allowing parent
windows to remain active.
This commit is contained in:
thankyouverycool 2022-08-22 13:54:38 -04:00 committed by Andreas Kling
parent 0d4fd4e2a6
commit 4c7f95e2f8
13 changed files with 23 additions and 91 deletions

View file

@ -109,7 +109,7 @@ ComboBox::ComboBox()
m_list_window = add<Window>(window());
m_list_window->set_frameless(true);
m_list_window->set_accessory(true);
m_list_window->set_window_mode(WindowMode::CaptureInput);
m_list_window->on_active_input_change = [this](bool is_active_input) {
if (!is_active_input) {
m_open_button->set_enabled(false);

View file

@ -731,7 +731,7 @@ bool Widget::is_focused() const
auto* win = window();
if (!win)
return false;
// Accessory windows are not active despite being the active
// Capturing modals are not active despite being the active
// input window. So we can have focus if either we're the active
// input window or we're the active window
if (win->is_active_input() || win->is_active())

View file

@ -153,7 +153,6 @@ void Window::show()
m_fullscreen,
m_frameless,
m_forced_shadow,
m_accessory,
m_opacity_when_windowless,
m_alpha_hit_threshold,
m_base_size,

View file

@ -124,9 +124,6 @@ public:
bool is_active() const;
bool is_active_input() const { return m_is_active_input; }
bool is_accessory() const { return m_accessory; }
void set_accessory(bool accessory) { m_accessory = accessory; }
void show();
void hide();
virtual void close();
@ -306,7 +303,6 @@ private:
bool m_layout_pending { false };
bool m_visible_for_timer_purposes { true };
bool m_visible { false };
bool m_accessory { false };
bool m_moved_by_client { false };
};