summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/Window.h
diff options
context:
space:
mode:
authorMatthew Jones <matthewbjones85@gmail.com>2021-06-01 22:08:47 -0600
committerAndreas Kling <kling@serenityos.org>2021-06-02 18:22:05 +0200
commit123848f0c1c4513fd5e175248b6da0f753c8ddaf (patch)
treec34fef6a9690b60c27fe9793a93cb1150274f428 /Userland/Libraries/LibGUI/Window.h
parent97202615405e2ec8128083c8780587747be3895c (diff)
downloadserenity-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.h2
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;