[gnome-applets/gnome-3-36] command: remove old timeout before adding new



commit c1d3b8cb7b83a6383c6ea147832634ef104d7d68
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Mar 27 18:46:14 2020 +0200

    command: remove old timeout before adding new
    
    https://gitlab.gnome.org/GNOME/gnome-panel/-/issues/23

 command/src/command.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/command/src/command.c b/command/src/command.c
index 20e3ecd4a..536c22c6b 100644
--- a/command/src/command.c
+++ b/command/src/command.c
@@ -216,6 +216,13 @@ settings_width_changed (GSettings *settings, gchar *key, CommandApplet *command_
 
     command_applet->width = width;
 
+    /* stop current timer */
+    if (command_applet->timeout_id != 0)
+    {
+        g_source_remove (command_applet->timeout_id);
+        command_applet->timeout_id = 0;
+    }
+
     /* execute command to start new timer */
     command_execute (command_applet);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]