Waybar/include/util
André Aparício a1cd0acac5 Fix random segfault on GTK icon functions
The segfaults were happening on GTK icon theme functions, which are
called via the C++ interface functions such as Gtk::IconTheme::has_icon.

There are multiple modules and threads using this functions on the default
icon theme by calling Gtk::IconTheme::get_default(), which returns the same
object for all callers, and was causing concurrent access to the same internal
data structures on the GTK lib. Even a seemingly read-only function such as
has_icon can cause writes due to the internal icon cache being updated.

To avoid this issues, a program wide global mutex must be used to ensure
a single thread is accessing the default icon theme instance.

This commit implements wrappers for the existing IconTheme function calls,
ensuring the global lock is held while calling the underling GTK functions.
2023-07-03 22:32:24 +01:00
..
SafeSignal.hpp refactor: lint 2022-04-06 08:37:19 +02:00
clara.hpp fix: lint 2023-04-03 09:41:24 +02:00
command.hpp fix: lint 2023-05-29 09:24:33 +02:00
date.hpp feat(clock): support chrono Time Zone extensions. 2023-01-21 02:18:44 -08:00
format.hpp fix: compilation errors with cpp_std=c++20 2023-01-20 22:50:02 -08:00
gtk_icon.hpp Fix random segfault on GTK icon functions 2023-07-03 22:32:24 +01:00
json.hpp fix: adapt to fmt 9.0.0 breaking changes 2022-07-13 22:36:32 -07:00
prepare_for_sleep.h Wake all sleeping threads when leaving suspend 2023-06-07 10:17:42 +02:00
rewrite_string.hpp Rename function name 2023-03-25 17:33:01 +01:00
rfkill.hpp refactor: lint 2022-04-06 08:37:19 +02:00
sanitize_str.hpp utils: add sanitize_str to encode '&' etc. 2022-10-17 00:31:19 +02:00
sleeper_thread.hpp Wake all sleeping threads when leaving suspend 2023-06-07 10:17:42 +02:00
string.hpp ltrim and rtrim take argument by const-ref 2022-02-05 21:02:58 +01:00
ustring_clen.hpp Use g_unichar_iswide to properly align calendar on CJK locales 2021-01-31 11:53:53 -08:00