mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-10-30 23:42:42 +01:00 
			
		
		
		
	 45988b3dbb
			
		
	
	45988b3dbb
	
	
	
		
			
			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
		
	
		
			
				
	
	
		
			45 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| #include <fmt/format.h>
 | |
| 
 | |
| #include <tuple>
 | |
| 
 | |
| #include "AIconLabel.hpp"
 | |
| #include "bar.hpp"
 | |
| #include "client.hpp"
 | |
| #include "modules/sway/ipc/client.hpp"
 | |
| #include "util/json.hpp"
 | |
| 
 | |
| namespace waybar::modules::sway {
 | |
| 
 | |
| class Window : public AIconLabel, public sigc::trackable {
 | |
|  public:
 | |
|   Window(const std::string&, const waybar::Bar&, const Json::Value&);
 | |
|   ~Window() = default;
 | |
|   auto update() -> void;
 | |
| 
 | |
|  private:
 | |
|   void onEvent(const struct Ipc::ipc_response&);
 | |
|   void onCmd(const struct Ipc::ipc_response&);
 | |
|   std::tuple<std::size_t, int, std::string, std::string> getFocusedNode(const Json::Value& nodes,
 | |
|                                                                         std::string& output);
 | |
|   void getTree();
 | |
|   std::string rewriteTitle(const std::string& title);
 | |
|   void updateAppIconName();
 | |
|   void updateAppIcon();
 | |
| 
 | |
|   const Bar& bar_;
 | |
|   std::string window_;
 | |
|   int windowId_;
 | |
|   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_;
 | |
| };
 | |
| 
 | |
| }  // namespace waybar::modules::sway
 |