diff options
author | Matthew Jones <matthewbjones85@gmail.com> | 2021-06-01 22:08:47 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-02 18:22:05 +0200 |
commit | 123848f0c1c4513fd5e175248b6da0f753c8ddaf (patch) | |
tree | c34fef6a9690b60c27fe9793a93cb1150274f428 /Userland/Libraries/LibGUI/Window.h | |
parent | 97202615405e2ec8128083c8780587747be3895c (diff) | |
download | serenity-123848f0c1c4513fd5e175248b6da0f753c8ddaf.zip |
LibGUI: Fixes Widget->set_visible(false) still maintains focus bug
When setting a Widget->set_visible(false), if that Widget->has_focus()
it will continue to have focus, even though it's not visible to the user
anymore.
Now calling Widget->set_visible(false) will remove focus from the Widget
if it had focus, and the Window will give focus back to the Widget
that had it previously, if there was one.
Diffstat (limited to 'Userland/Libraries/LibGUI/Window.h')
-rw-r--r-- | Userland/Libraries/LibGUI/Window.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/Window.h b/Userland/Libraries/LibGUI/Window.h index ad4bd7e3dc..662141ff4b 100644 --- a/Userland/Libraries/LibGUI/Window.h +++ b/Userland/Libraries/LibGUI/Window.h @@ -228,6 +228,8 @@ private: void flip(const Vector<Gfx::IntRect, 32>& dirty_rects); void force_update(); + WeakPtr<Widget> m_previously_focused_widget; + OwnPtr<WindowBackingStore> m_front_store; OwnPtr<WindowBackingStore> m_back_store; |