summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-02-27 07:36:18 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-02-27 07:36:18 +0000
commitce06d6d635ea1d2c42ff0e5f317685cb0aa2ba5b (patch)
treef7c6867e733b41c5da9e90a9dcf088a0c2d17b58
parentb501a17c8b12844085419cf818b572de4bce0900 (diff)
downloadgdk-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--ChangeLog20
-rw-r--r--ChangeLog.pre-2-020
-rw-r--r--ChangeLog.pre-2-1020
-rw-r--r--ChangeLog.pre-2-220
-rw-r--r--ChangeLog.pre-2-420
-rw-r--r--ChangeLog.pre-2-620
-rw-r--r--ChangeLog.pre-2-820
-rw-r--r--gtk/gtkdnd.c29
-rw-r--r--gtk/gtkmain.c32
9 files changed, 182 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 5e821b8dc..d95166803 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 */
}
}