diff options
author | Owen Taylor <owt1@cornell.edu> | 1998-04-14 01:39:40 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1998-04-14 01:39:40 +0000 |
commit | 385164d6f9c34a456667f90a8e7a98782871f08f (patch) | |
tree | 5c637d8fb96a5b3d26d5b14eb0d88e3e7788ed04 /gdk/gdk.c | |
parent | 1bafe5a8e7e247cb1550070b3a725acd3b1f556d (diff) | |
download | gtk+-385164d6f9c34a456667f90a8e7a98782871f08f.tar.gz |
Don't read the character past the end of the text.
Mon Apr 13 21:40:14 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtktext.c (find_char_width): Don't read the
character past the end of the text.
* gtk/gtkrange.c (gtk_real_range_timer): If the mouse
button has been released before the timer is activated,
don't keep on scrolling.
* gdk/gdk.c (gdk_event_translate): Filter subsequent configure
events after we discard the first. Removed obsolete and
sometimes very slow GdkOtherEvent. (Left in gdktypes.h
with signal in GTK)
Diffstat (limited to 'gdk/gdk.c')
-rw-r--r-- | gdk/gdk.c | 45 |
1 files changed, 26 insertions, 19 deletions
@@ -223,9 +223,6 @@ static GList* xim_ic_list; #endif -#define OTHER_XEVENT_BUFSIZE 4 -static XEvent other_xevent[OTHER_XEVENT_BUFSIZE]; /* XEvents passed along to user */ -static int other_xevent_i = 0; static GList *putback_events = NULL; static gulong base_id; @@ -2546,10 +2543,30 @@ gdk_event_translate (GdkEvent *event, while ((XPending (gdk_display) > 0) && XCheckTypedWindowEvent(gdk_display, xevent->xany.window, ConfigureNotify, xevent)) - GDK_NOTE (EVENTS, - g_print ("configure notify discarded:\twindow: %ld\n", - xevent->xconfigure.window - base_id)); - /*XSync (gdk_display, 0);*/ + { + GdkFilterReturn result; + + GDK_NOTE (EVENTS, + g_print ("configure notify discarded:\twindow: %ld\n", + xevent->xconfigure.window - base_id)); + + result = gdk_event_apply_filters (xevent, event, + window_private + ?window_private->filters + :gdk_default_filters); + + /* If the result is GDK_FILTER_REMOVE, there will be + * trouble, but anybody who filtering the Configure events + * better know what they are doing + */ + if (result != GDK_FILTER_CONTINUE) + { + return (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE; + } + + /*XSync (gdk_display, 0);*/ + } + GDK_NOTE (EVENTS, g_print ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d\n", @@ -2931,19 +2948,9 @@ gdk_event_translate (GdkEvent *event, gdk_input_vtable.other_event) return_val = gdk_input_vtable.other_event(event, xevent, window); else - return_val = -1; + return_val = FALSE; - if (return_val < 0) /* not an XInput event, convert */ - { - event->other.type = GDK_OTHER_EVENT; - event->other.window = window; - event->other.xevent = (GdkXEvent *)&other_xevent[other_xevent_i]; - memcpy (&other_xevent[other_xevent_i], xevent, sizeof (XEvent)); - other_xevent_i = (other_xevent_i+1) % OTHER_XEVENT_BUFSIZE; - return_val = TRUE; - } - else - return_val = return_val && !window_private->destroyed; + return_val = return_val && !window_private->destroyed; break; } |