diff options
author | Timothy Flynn <trflynn89@pm.me> | 2022-09-06 10:33:18 -0400 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-09-07 14:34:02 +0100 |
commit | a88540651168c9b6f7c4ed2d8f7cc23c8dc5e5f9 (patch) | |
tree | 3012e7f019a317b3c4413983a054eaef8401af13 /Userland/Libraries | |
parent | 1c32823dd84135ac581745b904a339da6d15317c (diff) | |
download | serenity-a88540651168c9b6f7c4ed2d8f7cc23c8dc5e5f9.zip |
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.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibGUI/EmojiInputDialog.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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 <AK/LexicalPath.h> +#include <AK/ScopeGuard.h> #include <AK/StringBuilder.h> #include <AK/Utf32View.h> #include <LibCore/DirIterator.h> @@ -89,6 +90,9 @@ auto EmojiInputDialog::supported_emoji() -> Vector<Emoji> 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; |