1
0
mirror of https://github.com/rad4day/Waybar.git synced 2023-12-21 10:22:59 +01:00

refactor(workspaces): cleaner handle resume

This commit is contained in:
Alexis 2018-08-09 01:14:06 +02:00
parent c1e2735314
commit 81b5c37d86

@ -5,13 +5,16 @@ 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);
if (!o->thread) {
o->updateThread(); 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 = {
.idle = handle_idle, .idle = handle_idle,