]> Pileus Git - ~andy/gtk/commitdiff
take expired timeouts into account, otherwise things like e.g.
authorTim Janik <timj@gtk.org>
Sun, 5 Apr 1998 09:18:08 +0000 (09:18 +0000)
committerTim Janik <timj@src.gnome.org>
Sun, 5 Apr 1998 09:18:08 +0000 (09:18 +0000)
Sun Apr  5 09:35:55 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkmain.c (gtk_events_pending): take expired timeouts into
                account, otherwise things like e.g. spin-buttons don't work.
                        also, count gtk_main_quit() as an event.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkmain.c

index 17d009b4cd0d0af22433c8655cb50982e6e255f0..59edf8fd91fa23615e878b3046720d9fba67770d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sun Apr  5 09:35:55 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.c (gtk_events_pending): take expired timeouts into
+       account, otherwise things like e.g. spin-buttons don't work.
+       also, count gtk_main_quit() as an event.
+
 Sun Apr  5 08:03:01 1998  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkspinbutton.c: fixed panel allocation and stacking order,
index 17d009b4cd0d0af22433c8655cb50982e6e255f0..59edf8fd91fa23615e878b3046720d9fba67770d 100644 (file)
@@ -1,3 +1,9 @@
+Sun Apr  5 09:35:55 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.c (gtk_events_pending): take expired timeouts into
+       account, otherwise things like e.g. spin-buttons don't work.
+       also, count gtk_main_quit() as an event.
+
 Sun Apr  5 08:03:01 1998  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkspinbutton.c: fixed panel allocation and stacking order,
index 17d009b4cd0d0af22433c8655cb50982e6e255f0..59edf8fd91fa23615e878b3046720d9fba67770d 100644 (file)
@@ -1,3 +1,9 @@
+Sun Apr  5 09:35:55 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.c (gtk_events_pending): take expired timeouts into
+       account, otherwise things like e.g. spin-buttons don't work.
+       also, count gtk_main_quit() as an event.
+
 Sun Apr  5 08:03:01 1998  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkspinbutton.c: fixed panel allocation and stacking order,
index 17d009b4cd0d0af22433c8655cb50982e6e255f0..59edf8fd91fa23615e878b3046720d9fba67770d 100644 (file)
@@ -1,3 +1,9 @@
+Sun Apr  5 09:35:55 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.c (gtk_events_pending): take expired timeouts into
+       account, otherwise things like e.g. spin-buttons don't work.
+       also, count gtk_main_quit() as an event.
+
 Sun Apr  5 08:03:01 1998  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkspinbutton.c: fixed panel allocation and stacking order,
index 17d009b4cd0d0af22433c8655cb50982e6e255f0..59edf8fd91fa23615e878b3046720d9fba67770d 100644 (file)
@@ -1,3 +1,9 @@
+Sun Apr  5 09:35:55 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.c (gtk_events_pending): take expired timeouts into
+       account, otherwise things like e.g. spin-buttons don't work.
+       also, count gtk_main_quit() as an event.
+
 Sun Apr  5 08:03:01 1998  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkspinbutton.c: fixed panel allocation and stacking order,
index 17d009b4cd0d0af22433c8655cb50982e6e255f0..59edf8fd91fa23615e878b3046720d9fba67770d 100644 (file)
@@ -1,3 +1,9 @@
+Sun Apr  5 09:35:55 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.c (gtk_events_pending): take expired timeouts into
+       account, otherwise things like e.g. spin-buttons don't work.
+       also, count gtk_main_quit() as an event.
+
 Sun Apr  5 08:03:01 1998  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkspinbutton.c: fixed panel allocation and stacking order,
index 17d009b4cd0d0af22433c8655cb50982e6e255f0..59edf8fd91fa23615e878b3046720d9fba67770d 100644 (file)
@@ -1,3 +1,9 @@
+Sun Apr  5 09:35:55 1998  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkmain.c (gtk_events_pending): take expired timeouts into
+       account, otherwise things like e.g. spin-buttons don't work.
+       also, count gtk_main_quit() as an event.
+
 Sun Apr  5 08:03:01 1998  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkspinbutton.c: fixed panel allocation and stacking order,
index 283ba1831037ff8307d58e588ed6f069e30b6765..4f24f27224e889236e86a69a28efd15fd4fae67e 100644 (file)
@@ -419,13 +419,38 @@ gtk_main_quit ()
 gint
 gtk_events_pending (void)
 {
-  gint result = gdk_events_pending() + ((next_event != NULL) ? 1 : 0);
+  gint result = 0;
+  
+  /* if this function is called from a timeout which will only return
+   * if gtk needs processor time, we need to take iteration_done==TRUE
+   * into account as well.
+   */
+  result = iteration_done;
+  result += next_event != NULL;
+  result += gdk_events_pending();
 
-  if (idle_functions &&
-      (((GtkIdleFunction *)idle_functions->data)->priority <=
-       GTK_PRIORITY_INTERNAL))
-    result += 1;
+  result += current_idles != NULL;
+  result += current_timeouts != NULL;
 
+  if (!result)
+    {
+      result += (idle_functions &&
+                (((GtkIdleFunction *)idle_functions->data)->priority <=
+                 GTK_PRIORITY_INTERNAL));
+    }
+  
+  if (!result && timeout_functions)
+    {
+      guint32 the_time;
+      GtkTimeoutFunction *timeoutf;
+      
+      the_time = gdk_time_get ();
+      
+      timeoutf = timeout_functions->data;
+      
+      result += timeoutf->interval <= (the_time - timeoutf->start);
+    }
+  
   return result;
 }
 
@@ -1395,7 +1420,7 @@ gtk_handle_timeouts ()
        }
       
       if (current_timeouts)
-       gtk_handle_current_timeouts(the_time);
+       gtk_handle_current_timeouts (the_time);
     }
 }