mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-10-30 23:42:42 +01:00 
			
		
		
		
	refactor(workspaces): cleaner handle resume
This commit is contained in:
		| @@ -5,12 +5,15 @@ static void handle_idle(void *data, struct org_kde_kwin_idle_timeout *timer) { | |||||||
| 	auto o = reinterpret_cast<waybar::modules::WorkspaceSelector *>(data); | 	auto o = reinterpret_cast<waybar::modules::WorkspaceSelector *>(data); | ||||||
|   if (o->thread) { |   if (o->thread) { | ||||||
| 	  delete o->thread; | 	  delete o->thread; | ||||||
|  |     o->thread = nullptr; | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| static void handle_resume(void *data, struct org_kde_kwin_idle_timeout *timer) { | static void handle_resume(void *data, struct org_kde_kwin_idle_timeout *timer) { | ||||||
| 	auto o = reinterpret_cast<waybar::modules::WorkspaceSelector *>(data); | 	auto o = reinterpret_cast<waybar::modules::WorkspaceSelector *>(data); | ||||||
| 	o->updateThread(); |   if (!o->thread) { | ||||||
|  | 	  o->updateThread(); | ||||||
|  |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| static const struct org_kde_kwin_idle_timeout_listener idle_timer_listener = { | static const struct org_kde_kwin_idle_timeout_listener idle_timer_listener = { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Alexis
					Alexis