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)
This commit is contained in:
Owen Taylor 1998-04-14 01:39:40 +00:00 committed by Owen Taylor
parent 1bafe5a8e7
commit 385164d6f9
11 changed files with 180 additions and 42 deletions

View File

@ -1,3 +1,17 @@
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)
Mon Apr 13 18:03:54 PDT 1998 Shawn T. Amundson <amundson@gtk.org>
* README: update address info to gtk.org for ftp and web sites.

View File

@ -1,3 +1,17 @@
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)
Mon Apr 13 18:03:54 PDT 1998 Shawn T. Amundson <amundson@gtk.org>
* README: update address info to gtk.org for ftp and web sites.

View File

@ -1,3 +1,17 @@
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)
Mon Apr 13 18:03:54 PDT 1998 Shawn T. Amundson <amundson@gtk.org>
* README: update address info to gtk.org for ftp and web sites.

View File

@ -1,3 +1,17 @@
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)
Mon Apr 13 18:03:54 PDT 1998 Shawn T. Amundson <amundson@gtk.org>
* README: update address info to gtk.org for ftp and web sites.

View File

@ -1,3 +1,17 @@
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)
Mon Apr 13 18:03:54 PDT 1998 Shawn T. Amundson <amundson@gtk.org>
* README: update address info to gtk.org for ftp and web sites.

View File

@ -1,3 +1,17 @@
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)
Mon Apr 13 18:03:54 PDT 1998 Shawn T. Amundson <amundson@gtk.org>
* README: update address info to gtk.org for ftp and web sites.

View File

@ -1,3 +1,17 @@
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)
Mon Apr 13 18:03:54 PDT 1998 Shawn T. Amundson <amundson@gtk.org>
* README: update address info to gtk.org for ftp and web sites.

View File

@ -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;
}

View File

@ -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;
}

View File

@ -1165,6 +1165,8 @@ gtk_real_range_timer (GtkRange *range)
}
else
{
GdkModifierType mods, mask;
if (!range->timer)
{
return_val = FALSE;
@ -1177,8 +1179,26 @@ gtk_real_range_timer (GtkRange *range)
range->need_timer = FALSE;
}
if (gtk_range_scroll (range, -1))
return return_val;
switch (range->button)
{
case 1:
mask = GDK_BUTTON1_MASK;
break;
case 2:
mask = GDK_BUTTON2_MASK;
break;
case 3:
mask = GDK_BUTTON3_MASK;
break;
default:
mask = 0;
break;
}
gdk_window_get_pointer (range->slider, NULL, NULL, &mods);
if (mods & mask)
return_val = gtk_range_scroll (range, -1);
}
return return_val;

View File

@ -2972,8 +2972,14 @@ pixel_height_of (GtkText* text, GList* cache_line)
static gint
find_char_width (GtkText* text, const GtkPropertyMark *mark, const TabStopMark *tab_mark)
{
gchar ch = GTK_TEXT_INDEX (text, mark->index);
gint16* char_widths = MARK_CURRENT_TEXT_FONT (mark)->char_widths;
gchar ch;
gint16* char_widths;
if (LAST_INDEX (text, *mark))
return 0;
ch = GTK_TEXT_INDEX (text, mark->index);
char_widths = MARK_CURRENT_TEXT_FONT (mark)->char_widths;
if (ch == '\t')
{