From a88540651168c9b6f7c4ed2d8f7cc23c8dc5e5f9 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 6 Sep 2022 10:33:18 -0400 Subject: [PATCH] LibGUI: Disable EmojiInputDialog updates while re-displaying emoji To prevent lag when the displayed code points are redrawn in support of a search box, disable updates while re-adding the emoji buttons. --- Userland/Libraries/LibGUI/EmojiInputDialog.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp index f17dae1e02..5ae43d410d 100644 --- a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp +++ b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -89,6 +90,9 @@ auto EmojiInputDialog::supported_emoji() -> Vector void EmojiInputDialog::update_displayed_emoji() { + ScopeGuard guard { [&] { m_emojis_widget->set_updates_enabled(true); } }; + m_emojis_widget->set_updates_enabled(false); + constexpr size_t columns = 18; size_t rows = ceil_div(m_emojis.size(), columns); size_t index = 0;