From 84ae41422f04525bd10005945fb388c286f004a2 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Mon, 15 Jul 2019 02:12:20 -0400 Subject: [PATCH] notification: Prevent the timer to be started early in the constructor. Otherwise the timer will be started before the preset is applied. --- lib/naughty/notification.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/naughty/notification.lua b/lib/naughty/notification.lua index fd13beb5..c2bfa04c 100644 --- a/lib/naughty/notification.lua +++ b/lib/naughty/notification.lua @@ -439,7 +439,11 @@ end function notification:reset_timeout(new_timeout) if self.timer then self.timer:stop() end - self.timeout = new_timeout or self.timeout + -- Do not set `self.timeout` to `self.timeout` since that would create the + -- timer before the constructor ends. + if new_timeout and self.timer then + self.timeout = new_timeout or self.timeout + end if self.timer and not self.timer.started then self.timer:start()