If the widget is _not_ a descendant of a Window widget, propagate key

Fri Mar 27 00:13:18 1998  Owen Taylor  <owt1@cornell.edu>

	* gtk/gtkmain.c (gtk_propagate_event): If the widget is _not_
	a descendant of a Window widget, propagate key presses like
	other events.

	* gtk/gtkentry.c gtk/gtktext.c: Ignore multiple simultaneous
	button presses instead of treating subsequent presses as
	release/press pairs for tablet compatibility.

	* configure.in config.h.in: Removed inline checks, because they
	are duplicated in glib.

	* gtk/gtkwidget.c (gtk_widget_draw): When gtk_widget_draw ()
	occurs with queued draw already in place, redraw _entire_
	widget. (Pointed out by Tim Janik)
This commit is contained in:
Owen Taylor 1998-03-27 05:17:11 +00:00 committed by Owen Taylor
parent 11f79ebe18
commit e0ea1f0c14
17 changed files with 187 additions and 57 deletions

View File

@ -1,3 +1,20 @@
Fri Mar 27 00:13:18 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkmain.c (gtk_propagate_event): If the widget is _not_
a descendant of a Window widget, propagate key presses like
other events.
* gtk/gtkentry.c gtk/gtktext.c: Ignore multiple simultaneous
button presses instead of treating subsequent presses as
release/press pairs for tablet compatibility.
* configure.in config.h.in: Removed inline checks, because they
are duplicated in glib.
* gtk/gtkwidget.c (gtk_widget_draw): When gtk_widget_draw ()
occurs with queued draw already in place, redraw _entire_
widget. (Pointed out by Tim Janik)
Thu Mar 26 23:12:54 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_propagate_event): make a clear distinction between

View File

@ -1,3 +1,20 @@
Fri Mar 27 00:13:18 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkmain.c (gtk_propagate_event): If the widget is _not_
a descendant of a Window widget, propagate key presses like
other events.
* gtk/gtkentry.c gtk/gtktext.c: Ignore multiple simultaneous
button presses instead of treating subsequent presses as
release/press pairs for tablet compatibility.
* configure.in config.h.in: Removed inline checks, because they
are duplicated in glib.
* gtk/gtkwidget.c (gtk_widget_draw): When gtk_widget_draw ()
occurs with queued draw already in place, redraw _entire_
widget. (Pointed out by Tim Janik)
Thu Mar 26 23:12:54 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_propagate_event): make a clear distinction between

View File

@ -1,3 +1,20 @@
Fri Mar 27 00:13:18 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkmain.c (gtk_propagate_event): If the widget is _not_
a descendant of a Window widget, propagate key presses like
other events.
* gtk/gtkentry.c gtk/gtktext.c: Ignore multiple simultaneous
button presses instead of treating subsequent presses as
release/press pairs for tablet compatibility.
* configure.in config.h.in: Removed inline checks, because they
are duplicated in glib.
* gtk/gtkwidget.c (gtk_widget_draw): When gtk_widget_draw ()
occurs with queued draw already in place, redraw _entire_
widget. (Pointed out by Tim Janik)
Thu Mar 26 23:12:54 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_propagate_event): make a clear distinction between

View File

@ -1,3 +1,20 @@
Fri Mar 27 00:13:18 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkmain.c (gtk_propagate_event): If the widget is _not_
a descendant of a Window widget, propagate key presses like
other events.
* gtk/gtkentry.c gtk/gtktext.c: Ignore multiple simultaneous
button presses instead of treating subsequent presses as
release/press pairs for tablet compatibility.
* configure.in config.h.in: Removed inline checks, because they
are duplicated in glib.
* gtk/gtkwidget.c (gtk_widget_draw): When gtk_widget_draw ()
occurs with queued draw already in place, redraw _entire_
widget. (Pointed out by Tim Janik)
Thu Mar 26 23:12:54 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_propagate_event): make a clear distinction between

View File

@ -1,3 +1,20 @@
Fri Mar 27 00:13:18 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkmain.c (gtk_propagate_event): If the widget is _not_
a descendant of a Window widget, propagate key presses like
other events.
* gtk/gtkentry.c gtk/gtktext.c: Ignore multiple simultaneous
button presses instead of treating subsequent presses as
release/press pairs for tablet compatibility.
* configure.in config.h.in: Removed inline checks, because they
are duplicated in glib.
* gtk/gtkwidget.c (gtk_widget_draw): When gtk_widget_draw ()
occurs with queued draw already in place, redraw _entire_
widget. (Pointed out by Tim Janik)
Thu Mar 26 23:12:54 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_propagate_event): make a clear distinction between

View File

@ -1,3 +1,20 @@
Fri Mar 27 00:13:18 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkmain.c (gtk_propagate_event): If the widget is _not_
a descendant of a Window widget, propagate key presses like
other events.
* gtk/gtkentry.c gtk/gtktext.c: Ignore multiple simultaneous
button presses instead of treating subsequent presses as
release/press pairs for tablet compatibility.
* configure.in config.h.in: Removed inline checks, because they
are duplicated in glib.
* gtk/gtkwidget.c (gtk_widget_draw): When gtk_widget_draw ()
occurs with queued draw already in place, redraw _entire_
widget. (Pointed out by Tim Janik)
Thu Mar 26 23:12:54 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_propagate_event): make a clear distinction between

View File

@ -1,3 +1,20 @@
Fri Mar 27 00:13:18 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkmain.c (gtk_propagate_event): If the widget is _not_
a descendant of a Window widget, propagate key presses like
other events.
* gtk/gtkentry.c gtk/gtktext.c: Ignore multiple simultaneous
button presses instead of treating subsequent presses as
release/press pairs for tablet compatibility.
* configure.in config.h.in: Removed inline checks, because they
are duplicated in glib.
* gtk/gtkwidget.c (gtk_widget_draw): When gtk_widget_draw ()
occurs with queued draw already in place, redraw _entire_
widget. (Pointed out by Tim Janik)
Thu Mar 26 23:12:54 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_propagate_event): make a clear distinction between

29
TODO
View File

@ -188,20 +188,27 @@ TODO AFTER GTK 1.0
- In word wrap mode, break:
aaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
aaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
as:
| Maximum column
aaaaaaaaaaa bbbbbbbbbbb|
bbbbbbbbbbbbbbbbbbbbbbb|
bbbbbbbbb |
as:
| Maximum column
aaaaaaaaaaa bbbbbbbbbbb|
bbbbbbbbbbbbbbbbbbbbbbb|
bbbbbbbbb |
Instead of:
|
aaaaaaaaaaa |
bbbbbbbbbbbbbbbbbbbbbbb|
bbbbbbbbbbbbbbbbbbbb |
Instead of:
|
aaaaaaaaaaa |
bbbbbbbbbbbbbbbbbbbbbbb|
bbbbbbbbbbbbbbbbbbbb |
- Blinking cursor
- API's : gtk_text_clear, gtk_text_delete_lines (gint start, gint end),
gtk_text_append/prepend, gtk_text_insert_at (gint row, gint column),
some function to get the row/column from the x/y-coordinates of a
mouse click, some function to get the word/line under the mouse pointer
[ From: Stefan Jeske <jeske@braunschweig.netsurf.de> ]
? Allow moving the separator for paned widgets by dragging
it directly instead of using the handle.

View File

@ -6,9 +6,6 @@
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE

View File

@ -238,7 +238,6 @@ AC_HEADER_STDC
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
# Checks for library functions.
AC_TYPE_SIGNAL

View File

@ -1,3 +1,8 @@
Thu Mar 26 20:47:21 1998 Owen Taylor <owt1@cornell.edu>
* configure.in glib glibconfig.h.in: Add test for atexit/on_exit -
use on_exit if atexit not found in definition of ATEXIT.
Wed Mar 25 15:23:37 1998 Owen Taylor <owt1@cornell.edu>
* Makefile.am: Switched glibconfig.h rule from HEADERS

View File

@ -61,6 +61,8 @@ AC_HEADER_STDC
# Checks for library functions.
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(atexit on_exit)
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(long)

View File

@ -122,7 +122,11 @@
#endif /* CLAMP */
#ifndef ATEXIT
#define ATEXIT(proc) (atexit (proc))
# ifdef HAVE_ATEXIT
# define ATEXIT(proc) (atexit (proc))
# elif defined (HAVE_ON_EXIT)
# define ATEXIT(proc) (on_exit ((void (*)(int, void *))(proc), NULL))
# endif
#endif /* ATEXIT */

View File

@ -53,9 +53,15 @@
/* The number of bytes in a void *. */
#undef SIZEOF_VOID_P
/* Define if you have the atexit function. */
#undef HAVE_ATEXIT
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
/* Define if you have the on_exit function. */
#undef HAVE_ON_EXIT
/* Define if you have the strcasecmp function. */
#undef HAVE_STRCASECMP

View File

@ -727,15 +727,8 @@ gtk_entry_button_press (GtkWidget *widget,
entry = GTK_ENTRY (widget);
editable = GTK_EDITABLE (widget);
if (entry->button && (event->type == GDK_BUTTON_PRESS))
{
GdkEventButton release_event = *event;
release_event.type = GDK_BUTTON_RELEASE;
release_event.button = entry->button;
gtk_entry_button_release (widget, &release_event);
}
if (entry->button && (event->button != entry->button))
return FALSE;
entry->button = event->button;

View File

@ -1516,45 +1516,50 @@ static void
gtk_propagate_event (GtkWidget *widget,
GdkEvent *event)
{
gint handled_event;
g_return_if_fail (widget != NULL);
g_return_if_fail (event != NULL);
handled_event = FALSE;
if ((event->type == GDK_KEY_PRESS) ||
(event->type == GDK_KEY_RELEASE))
{
/* Only send key events to window widgets.
* The window widget will in turn pass the
/* Only send key events within Window widgets to the Window
* The Window widget will in turn pass the
* key event on to the currently focused widget
* for that window.
*/
GtkWidget *window;
widget = gtk_widget_get_ancestor (widget, gtk_window_get_type ());
if (widget && GTK_WIDGET_IS_SENSITIVE (widget))
gtk_widget_event (widget, event);
window = gtk_widget_get_ancestor (widget, gtk_window_get_type ());
if (window)
{
if (GTK_WIDGET_IS_SENSITIVE (window))
gtk_widget_event (window, event);
handled_event = TRUE; /* don't send to widget */
}
}
else
/* Other events get propagated up the widget tree
* so that parents can see the button and motion
* events of the children.
*/
while (!handled_event && widget)
{
gint handled_event;
/* Other events get propagated up the widget tree
* so that parents can see the button and motion
* events of the children.
*/
handled_event = FALSE;
while (!handled_event && widget)
{
GtkWidget *tmp;
GtkWidget *tmp;
gtk_widget_ref (widget);
handled_event = !GTK_WIDGET_IS_SENSITIVE (widget) || gtk_widget_event (widget, event);
tmp = widget->parent;
gtk_widget_unref (widget);
widget = tmp;
}
gtk_widget_ref (widget);
handled_event = !GTK_WIDGET_IS_SENSITIVE (widget) || gtk_widget_event (widget, event);
tmp = widget->parent;
gtk_widget_unref (widget);
widget = tmp;
}
}
static void
gtk_error (gchar *str)
{

View File

@ -1367,15 +1367,8 @@ gtk_text_button_press (GtkWidget *widget,
text = GTK_TEXT (widget);
editable = GTK_EDITABLE (widget);
if (text->button && (event->type == GDK_BUTTON_PRESS))
{
GdkEventButton release_event = *event;
release_event.type = GDK_BUTTON_RELEASE;
release_event.button = text->button;
gtk_text_button_release (widget, &release_event);
}
if (text->button && (event->button != text->button))
return FALSE;
text->button = event->button;