refactor(workspaces): cleaner handle resume

This commit is contained in:
Alexis 2018-08-09 01:14:06 +02:00
parent c1e2735314
commit 81b5c37d86
1 changed files with 4 additions and 1 deletions

View File

@ -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);
if (o->thread) {
delete o->thread;
o->thread = nullptr;
}
}
static void handle_resume(void *data, struct org_kde_kwin_idle_timeout *timer) {
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 = {