Skip to content

Commit 9034466

Browse files
committed
Fix timeout checks
1 parent 31bcca3 commit 9034466

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/AbstractBubble.vala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,14 @@ public class Notifications.AbstractBubble : Gtk.Window {
148148

149149
base.present ();
150150

151-
if (!IdleMonitor.get_default ().is_idle) {
151+
if (!IdleMonitor.get_default ().is_idle && timeout != 0) {
152152
timeout_id = Timeout.add (timeout, timeout_expired);
153153
}
154154
}
155155

156156
private void check_idle_status () {
157-
if (!IdleMonitor.get_default ().is_idle && timeout_id == 0) {
158-
Timeout.add (timeout, timeout_expired);
157+
if (!IdleMonitor.get_default ().is_idle && timeout_id == 0 && timeout != 0) {
158+
timeout_id = Timeout.add (timeout, timeout_expired);
159159
}
160160
}
161161

@@ -171,7 +171,7 @@ public class Notifications.AbstractBubble : Gtk.Window {
171171
private void pointer_leave () {
172172
close_revealer.reveal_child = false;
173173

174-
if (timeout == 0) {
174+
if (timeout_id == 0 && timeout != 0) {
175175
timeout_id = Timeout.add (timeout, timeout_expired);
176176
}
177177
}

0 commit comments

Comments
 (0)