mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-11-04 09:42:42 +01:00 
			
		
		
		
	fix(swaybar-ipc): better logs
This commit is contained in:
		@@ -18,7 +18,6 @@ struct swaybar_config {
 | 
			
		||||
  std::string id;
 | 
			
		||||
  std::string mode;
 | 
			
		||||
  std::string hidden_state;
 | 
			
		||||
  std::string position;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 
 | 
			
		||||
@@ -43,9 +43,6 @@ struct swaybar_config parseConfig(const Json::Value& payload) {
 | 
			
		||||
  if (auto hs = payload["hidden_state"]; hs.isString()) {
 | 
			
		||||
    conf.hidden_state = hs.asString();
 | 
			
		||||
  }
 | 
			
		||||
  if (auto position = payload["position"]; position.isString()) {
 | 
			
		||||
    conf.position = position.asString();
 | 
			
		||||
  }
 | 
			
		||||
  return conf;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -80,13 +77,17 @@ void BarIpcClient::onIpcEvent(const struct Ipc::ipc_response& res) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void BarIpcClient::onConfigUpdate(const swaybar_config& config) {
 | 
			
		||||
  spdlog::info("config update: {} {} {}", config.id, config.mode, config.position);
 | 
			
		||||
  spdlog::info("config update for {}: id {}, mode {}, hidden_state {}",
 | 
			
		||||
               bar_.bar_id,
 | 
			
		||||
               config.id,
 | 
			
		||||
               config.mode,
 | 
			
		||||
               config.hidden_state);
 | 
			
		||||
  bar_config_ = config;
 | 
			
		||||
  update();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void BarIpcClient::onVisibilityUpdate(bool visible_by_modifier) {
 | 
			
		||||
  spdlog::trace("visiblity update: {}", visible_by_modifier);
 | 
			
		||||
  spdlog::debug("visiblity update for {}: {}", bar_.bar_id, visible_by_modifier);
 | 
			
		||||
  visible_by_modifier_ = visible_by_modifier;
 | 
			
		||||
  update();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user