1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:37:36 +00:00

WindowServer: Make Menus the input window when showing them

This solves a problem where windows don't receive a WindowInputLeft
event when popup menus are opened. This prevented ComboBox being
closed when right clicking the application on the task bar.
This commit is contained in:
Tom 2020-07-15 10:13:13 -06:00 committed by Andreas Kling
parent 59596ff816
commit 8286e72187
8 changed files with 125 additions and 62 deletions

View file

@ -107,7 +107,10 @@ public:
void start_dnd_drag(ClientConnection&, const String& text, Gfx::Bitmap*, const String& data_type, const String& data);
void end_dnd_drag();
Window* active_window() { return m_active_window.ptr(); }
const Window* active_window() const { return m_active_window.ptr(); }
Window* active_input_window() { return m_active_input_window.ptr(); }
const Window* active_input_window() const { return m_active_input_window.ptr(); }
const ClientConnection* active_client() const;
bool active_window_is_modal() const { return m_active_window && m_active_window->is_modal(); }
@ -145,6 +148,8 @@ public:
bool set_resolution(int width, int height);
Gfx::IntSize resolution() const;
Window* set_active_input_window(Window*);
void restore_active_input_window(Window*);
void set_active_window(Window*, bool make_input = true);
void set_hovered_button(Button*);
@ -207,7 +212,7 @@ private:
void tell_wm_listener_about_window(Window& listener, Window&);
void tell_wm_listener_about_window_icon(Window& listener, Window&);
void tell_wm_listener_about_window_rect(Window& listener, Window&);
void pick_new_active_window(Window&);
bool pick_new_active_window(Window*);
void do_move_to_front(Window&, bool, bool);