diff --git a/src/modules/gamemode.cpp b/src/modules/gamemode.cpp index 10a7ec77..811f13ca 100644 --- a/src/modules/gamemode.cpp +++ b/src/modules/gamemode.cpp @@ -18,7 +18,6 @@ #include "glibmm/varianttype.h" #include "gtkmm/label.h" #include "gtkmm/tooltip.h" - #include "util/gtk_icon.hpp" namespace waybar::modules { diff --git a/src/modules/sway/window.cpp b/src/modules/sway/window.cpp index 6f97b2e5..50aea602 100644 --- a/src/modules/sway/window.cpp +++ b/src/modules/sway/window.cpp @@ -11,8 +11,8 @@ #include #include -#include "util/rewrite_string.hpp" #include "util/gtk_icon.hpp" +#include "util/rewrite_string.hpp" namespace waybar::modules::sway { diff --git a/src/modules/upower/upower.cpp b/src/modules/upower/upower.cpp index ea039345..1262d0a1 100644 --- a/src/modules/upower/upower.cpp +++ b/src/modules/upower/upower.cpp @@ -6,7 +6,6 @@ #include #include "gtkmm/tooltip.h" - #include "util/gtk_icon.hpp" namespace waybar::modules::upower { diff --git a/src/modules/upower/upower_tooltip.cpp b/src/modules/upower/upower_tooltip.cpp index fddb6884..45544bbc 100644 --- a/src/modules/upower/upower_tooltip.cpp +++ b/src/modules/upower/upower_tooltip.cpp @@ -4,7 +4,6 @@ #include "gtkmm/enums.h" #include "gtkmm/image.h" #include "gtkmm/label.h" - #include "util/gtk_icon.hpp" namespace waybar::modules::upower { diff --git a/src/util/gtk_icon.cpp b/src/util/gtk_icon.cpp index 70aeec27..5dd741f9 100644 --- a/src/util/gtk_icon.cpp +++ b/src/util/gtk_icon.cpp @@ -5,19 +5,18 @@ * access can cause data corruption and lead to invalid memory access and crashes. * Even concurrent calls that seem read only such as has_icon can cause issues because * the GTK lib may update the internal icon cache on this calls. -*/ + */ std::mutex DefaultGtkIconThemeWrapper::default_theme_mutex; bool DefaultGtkIconThemeWrapper::has_icon(const std::string& value) { - const std::lock_guard lock(default_theme_mutex); return Gtk::IconTheme::get_default()->has_icon(value); } -Glib::RefPtr DefaultGtkIconThemeWrapper::load_icon(const char *name, int tmp_size, Gtk::IconLookupFlags flags) { - +Glib::RefPtr DefaultGtkIconThemeWrapper::load_icon(const char* name, int tmp_size, + Gtk::IconLookupFlags flags) { const std::lock_guard lock(default_theme_mutex); auto default_theme = Gtk::IconTheme::get_default();