Sway/window: Only update icon from main thread

If Gtk objects get updated from other threads than the main thread GTK
can get confused. This is a regression of bcadf64031.

Fixes #1464, #1474
This commit is contained in:
Felix Weilbach
2022-04-17 22:55:58 +02:00
parent 54b1df69a9
commit 45988b3dbb
2 changed files with 25 additions and 6 deletions

View File

@ -25,6 +25,7 @@ class Window : public AIconLabel, public sigc::trackable {
std::string& output);
void getTree();
std::string rewriteTitle(const std::string& title);
void updateAppIconName();
void updateAppIcon();
const Bar& bar_;
@ -33,6 +34,8 @@ class Window : public AIconLabel, public sigc::trackable {
std::string app_id_;
std::string old_app_id_;
std::size_t app_nb_;
bool update_app_icon_{true};
std::string app_icon_name_;
util::JsonParser parser_;
std::mutex mutex_;
Ipc ipc_;