diff options
author | Owen Taylor <otaylor@redhat.com> | 1998-12-15 07:32:11 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1998-12-15 07:32:11 +0000 |
commit | a0c84d6818f278d273b43c651c345f2110bc7f37 (patch) | |
tree | cb07d50ab001a4538983c1d0421bcd69d9618cbf /gtk/gtkspinbutton.c | |
parent | 58475f05a54f7a165fe92adf8358f59cf0223c08 (diff) | |
download | gtk+-a0c84d6818f278d273b43c651c345f2110bc7f37.tar.gz |
Commented out testthreads from the build process, since we won't have any
Tue Dec 15 01:38:53 1998 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Commented out testthreads from
the build process, since we won't have any idea
how to create a thread.
* configure.in (LIBS): use glib-config ... gthread
so we always build a thread-compatible library.
* gtk/gtkaccellabel.c gtk/gtkclist.c gtk/gtkcolorsel.c
gtk/gtkcombo.c gtk/gtkcontainer.c gtk/gtkentry.c
gtk/gtklist.c gtk/gtkmenuitem.c gtk/gtknotebook.c
gtk/gtkrange.c gtk/gtkselection.c gtk/gtkspinbutton.c
gtk/gtktext.c gtk/gtktooltips.c gtk/gtkwidget.c:
Add GTK_THREADS_ENTER/LEAVE pairs around timeouts
and idles to account for the fact that they are no
longer called within the GTK+ lock.
* gtk/gtkprivate.h: Added definitions for locking
the main GTK+ mutex.
* gtk/gtkmain.c: Re-implement the main loop
in terms of the GLib main loop.
* gdk/gdk.h gdk/gdkthreads.c gdk/Makefile.am: Removed threading
functionality, as it seems better to subsume GDK within the
GTK+ lock than vice-versa.
* gdk/gdkevents.c: New file, containing event handling bits
from gdk.c.
* gdk/gdkevents.c: Implement event source for GDK
events.
* configure.in gdk/gdkevents.c: Removed attempts to
subtract base_id, which were already non-functional.
Diffstat (limited to 'gtk/gtkspinbutton.c')
-rw-r--r-- | gtk/gtkspinbutton.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 869a0f2656..58f69d616f 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -28,6 +28,7 @@ #include "gdk/gdkkeysyms.h" #include "gtkspinbutton.h" #include "gtkmain.h" +#include "gtkprivate.h" #include "gtksignal.h" @@ -907,8 +908,9 @@ gtk_spin_button_motion_notify (GtkWidget *widget, static gint gtk_spin_button_timer (GtkSpinButton *spin_button) { - g_return_val_if_fail (spin_button != NULL, FALSE); - g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), FALSE); + gboolean retval = FALSE; + + GTK_THREADS_ENTER; if (spin_button->timer) { @@ -923,22 +925,27 @@ gtk_spin_button_timer (GtkSpinButton *spin_button) spin_button->timer = gtk_timeout_add (SPIN_BUTTON_TIMER_DELAY, (GtkFunction) gtk_spin_button_timer, (gpointer) spin_button); - return FALSE; } - else if (spin_button->climb_rate > 0.0 && spin_button->timer_step - < spin_button->adjustment->page_increment) + else { - if (spin_button->timer_calls < MAX_TIMER_CALLS) - spin_button->timer_calls++; - else + if (spin_button->climb_rate > 0.0 && spin_button->timer_step + < spin_button->adjustment->page_increment) { - spin_button->timer_calls = 0; - spin_button->timer_step += spin_button->climb_rate; + if (spin_button->timer_calls < MAX_TIMER_CALLS) + spin_button->timer_calls++; + else + { + spin_button->timer_calls = 0; + spin_button->timer_step += spin_button->climb_rate; + } } + retval = TRUE; } - return TRUE; } - return FALSE; + + GTK_THREADS_LEAVE; + + return retval; } static void |