diff options
author | Owen Taylor <otaylor@redhat.com> | 2001-02-27 07:36:18 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2001-02-27 07:36:18 +0000 |
commit | ce06d6d635ea1d2c42ff0e5f317685cb0aa2ba5b (patch) | |
tree | f7c6867e733b41c5da9e90a9dcf088a0c2d17b58 | |
parent | b501a17c8b12844085419cf818b572de4bce0900 (diff) | |
download | gdk-pixbuf-ce06d6d635ea1d2c42ff0e5f317685cb0aa2ba5b.tar.gz |
When recursing, get the list of children and ref them all before walking
Tue Feb 27 02:29:20 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_find_widget): When recursing,
get the list of children and ref them all before walking
through the list, to prevent problems when the widget
hierarchy changes in ::drag_motion/drop handlers.
* gtk/gtkmain.c (gtk_propagate_event): Only activate
special key-press grab handling for widgets within
GtkWindows. Otherwise, fall through to normal case.
This prevents key events being sent twice to GtkInvisible
widgets, which can cause all sorts of mischief.
-rw-r--r-- | ChangeLog | 20 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 20 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 20 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 20 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 20 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 20 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 20 | ||||
-rw-r--r-- | gtk/gtkdnd.c | 29 | ||||
-rw-r--r-- | gtk/gtkmain.c | 32 |
9 files changed, 182 insertions, 19 deletions
@@ -1,3 +1,23 @@ +Tue Feb 27 02:29:20 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_find_widget): When recursing, + get the list of children and ref them all before walking + through the list, to prevent problems when the widget + hierarchy changes in ::drag_motion/drop handlers. + + * gtk/gtkmain.c (gtk_propagate_event): Only activate + special key-press grab handling for widgets within + GtkWindows. Otherwise, fall through to normal case. + + This prevents key events being sent twice to GtkInvisible + widgets, which can cause all sorts of mischief. + +Tue Feb 27 02:16:14 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkmain.c (gtk_propagate_event): Only do special + key handling for grabs on subwidgets, if the key press + actually occurs within + Tue Feb 27 01:29:34 2001 Owen Taylor <otaylor@redhat.com> * configure.in acconfig.h gdk/gdkfont.c gdk/gdkim.c INSTALL: Add a diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 5e821b8dc..d95166803 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,23 @@ +Tue Feb 27 02:29:20 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_find_widget): When recursing, + get the list of children and ref them all before walking + through the list, to prevent problems when the widget + hierarchy changes in ::drag_motion/drop handlers. + + * gtk/gtkmain.c (gtk_propagate_event): Only activate + special key-press grab handling for widgets within + GtkWindows. Otherwise, fall through to normal case. + + This prevents key events being sent twice to GtkInvisible + widgets, which can cause all sorts of mischief. + +Tue Feb 27 02:16:14 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkmain.c (gtk_propagate_event): Only do special + key handling for grabs on subwidgets, if the key press + actually occurs within + Tue Feb 27 01:29:34 2001 Owen Taylor <otaylor@redhat.com> * configure.in acconfig.h gdk/gdkfont.c gdk/gdkim.c INSTALL: Add a diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 5e821b8dc..d95166803 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,23 @@ +Tue Feb 27 02:29:20 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_find_widget): When recursing, + get the list of children and ref them all before walking + through the list, to prevent problems when the widget + hierarchy changes in ::drag_motion/drop handlers. + + * gtk/gtkmain.c (gtk_propagate_event): Only activate + special key-press grab handling for widgets within + GtkWindows. Otherwise, fall through to normal case. + + This prevents key events being sent twice to GtkInvisible + widgets, which can cause all sorts of mischief. + +Tue Feb 27 02:16:14 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkmain.c (gtk_propagate_event): Only do special + key handling for grabs on subwidgets, if the key press + actually occurs within + Tue Feb 27 01:29:34 2001 Owen Taylor <otaylor@redhat.com> * configure.in acconfig.h gdk/gdkfont.c gdk/gdkim.c INSTALL: Add a diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 5e821b8dc..d95166803 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,23 @@ +Tue Feb 27 02:29:20 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_find_widget): When recursing, + get the list of children and ref them all before walking + through the list, to prevent problems when the widget + hierarchy changes in ::drag_motion/drop handlers. + + * gtk/gtkmain.c (gtk_propagate_event): Only activate + special key-press grab handling for widgets within + GtkWindows. Otherwise, fall through to normal case. + + This prevents key events being sent twice to GtkInvisible + widgets, which can cause all sorts of mischief. + +Tue Feb 27 02:16:14 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkmain.c (gtk_propagate_event): Only do special + key handling for grabs on subwidgets, if the key press + actually occurs within + Tue Feb 27 01:29:34 2001 Owen Taylor <otaylor@redhat.com> * configure.in acconfig.h gdk/gdkfont.c gdk/gdkim.c INSTALL: Add a diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 5e821b8dc..d95166803 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,23 @@ +Tue Feb 27 02:29:20 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_find_widget): When recursing, + get the list of children and ref them all before walking + through the list, to prevent problems when the widget + hierarchy changes in ::drag_motion/drop handlers. + + * gtk/gtkmain.c (gtk_propagate_event): Only activate + special key-press grab handling for widgets within + GtkWindows. Otherwise, fall through to normal case. + + This prevents key events being sent twice to GtkInvisible + widgets, which can cause all sorts of mischief. + +Tue Feb 27 02:16:14 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkmain.c (gtk_propagate_event): Only do special + key handling for grabs on subwidgets, if the key press + actually occurs within + Tue Feb 27 01:29:34 2001 Owen Taylor <otaylor@redhat.com> * configure.in acconfig.h gdk/gdkfont.c gdk/gdkim.c INSTALL: Add a diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 5e821b8dc..d95166803 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,23 @@ +Tue Feb 27 02:29:20 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_find_widget): When recursing, + get the list of children and ref them all before walking + through the list, to prevent problems when the widget + hierarchy changes in ::drag_motion/drop handlers. + + * gtk/gtkmain.c (gtk_propagate_event): Only activate + special key-press grab handling for widgets within + GtkWindows. Otherwise, fall through to normal case. + + This prevents key events being sent twice to GtkInvisible + widgets, which can cause all sorts of mischief. + +Tue Feb 27 02:16:14 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkmain.c (gtk_propagate_event): Only do special + key handling for grabs on subwidgets, if the key press + actually occurs within + Tue Feb 27 01:29:34 2001 Owen Taylor <otaylor@redhat.com> * configure.in acconfig.h gdk/gdkfont.c gdk/gdkim.c INSTALL: Add a diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 5e821b8dc..d95166803 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,23 @@ +Tue Feb 27 02:29:20 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_find_widget): When recursing, + get the list of children and ref them all before walking + through the list, to prevent problems when the widget + hierarchy changes in ::drag_motion/drop handlers. + + * gtk/gtkmain.c (gtk_propagate_event): Only activate + special key-press grab handling for widgets within + GtkWindows. Otherwise, fall through to normal case. + + This prevents key events being sent twice to GtkInvisible + widgets, which can cause all sorts of mischief. + +Tue Feb 27 02:16:14 2001 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkmain.c (gtk_propagate_event): Only do special + key handling for grabs on subwidgets, if the key press + actually occurs within + Tue Feb 27 01:29:34 2001 Owen Taylor <otaylor@redhat.com> * configure.in acconfig.h gdk/gdkfont.c gdk/gdkim.c INSTALL: Add a diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index a3de71e95..9497e82d7 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -1270,16 +1270,30 @@ gtk_drag_find_widget (GtkWidget *widget, if (GTK_IS_CONTAINER (widget)) { GtkDragFindData new_data = *data; - + GList *children = gtk_container_children (GTK_CONTAINER (widget)); + GList *tmp_list; + new_data.x -= x_offset; new_data.y -= y_offset; new_data.found = FALSE; new_data.toplevel = FALSE; - - gtk_container_forall (GTK_CONTAINER (widget), - (GtkCallback)gtk_drag_find_widget, - &new_data); - + + g_list_foreach (children, (GFunc)gtk_widget_ref, NULL); + + tmp_list = children; + while (tmp_list) + { + GtkWidget *child = tmp_list->data; + + if (child->parent == widget) + gtk_drag_find_widget (child, &new_data); + + gtk_widget_unref (child); + tmp_list = tmp_list->next; + } + + g_list_free (children); + data->found = new_data.found; } @@ -2674,6 +2688,9 @@ gtk_drag_end (GtkDragSourceInfo *info, guint32 time) gtk_signal_disconnect_by_func (GTK_OBJECT (info->ipc_widget), GTK_SIGNAL_FUNC (gtk_drag_motion_cb), info); + gtk_signal_disconnect_by_func (GTK_OBJECT (info->ipc_widget), + GTK_SIGNAL_FUNC (gtk_drag_key_cb), + info); /* Send on a release pair to the the original * widget to convince it to release its grab. We need to diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index 051466bad..f11611812 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -1343,22 +1343,28 @@ gtk_propagate_event (GtkWidget *widget, window = gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW); - /* If there is a grab within the window, give the grab widget - * a first crack at the key event - */ - if (widget != window && GTK_WIDGET_HAS_GRAB (widget)) - handled_event = gtk_widget_event (widget, event); - - if (!handled_event) + if (window) { - window = gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW); - if (window) + /* If there is a grab within the window, give the grab widget + * a first crack at the key event + */ + if (widget != window && GTK_WIDGET_HAS_GRAB (widget)) { - if (GTK_WIDGET_IS_SENSITIVE (window)) - gtk_widget_event (window, event); - - handled_event = TRUE; /* don't send to widget */ + handled_event = gtk_widget_event (widget, event); + g_print ("Sent event to grab widget, %d\n", handled_event); + } + + if (!handled_event) + { + window = gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW); + if (window) + { + if (GTK_WIDGET_IS_SENSITIVE (window)) + gtk_widget_event (window, event); + } } + + handled_event = TRUE; /* don't send to widget */ } } |