From 81b5c37d863bfc4146058eb72af1dd39eb024e98 Mon Sep 17 00:00:00 2001 From: Alexis Date: Thu, 9 Aug 2018 01:14:06 +0200 Subject: [PATCH] refactor(workspaces): cleaner handle resume --- src/modules/workspaces.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/workspaces.cpp b/src/modules/workspaces.cpp index e7f9dbfb..1b2270af 100644 --- a/src/modules/workspaces.cpp +++ b/src/modules/workspaces.cpp @@ -5,12 +5,15 @@ static void handle_idle(void *data, struct org_kde_kwin_idle_timeout *timer) { auto o = reinterpret_cast(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(data); - o->updateThread(); + if (!o->thread) { + o->updateThread(); + } } static const struct org_kde_kwin_idle_timeout_listener idle_timer_listener = {