summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-06-13 19:35:08 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-06-13 19:35:08 +0000
commit8d79795203933f4417091d25d538b6a0d4e48e72 (patch)
treefff0304bb943f0a7be2a113f58fbe4a101999644
parent16fc6b1a2696747aad91357316ada576dba6e854 (diff)
downloadgdk-pixbuf-8d79795203933f4417091d25d538b6a0d4e48e72.tar.gz
Ignore all client events that were sent to a window that we don't know
Thu Jun 13 15:02:49 2002 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkdnd-x11.c: Ignore all client events that were sent to a window that we don't know about or to a foreign window. (#81543, Young-Ho, Cha)
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLog.pre-2-106
-rw-r--r--ChangeLog.pre-2-26
-rw-r--r--ChangeLog.pre-2-46
-rw-r--r--ChangeLog.pre-2-66
-rw-r--r--ChangeLog.pre-2-86
-rw-r--r--gdk/x11/gdkdnd-x11.c65
7 files changed, 86 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 95eec2c2b..1ff7a343f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Jun 13 15:02:49 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkdnd-x11.c: Ignore all client events that
+ were sent to a window that we don't know about or
+ to a foreign window. (#81543, Young-Ho, Cha)
+
Thu Jun 13 12:24:09 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_set_filename):
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 95eec2c2b..1ff7a343f 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,9 @@
+Thu Jun 13 15:02:49 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkdnd-x11.c: Ignore all client events that
+ were sent to a window that we don't know about or
+ to a foreign window. (#81543, Young-Ho, Cha)
+
Thu Jun 13 12:24:09 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_set_filename):
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 95eec2c2b..1ff7a343f 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,9 @@
+Thu Jun 13 15:02:49 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkdnd-x11.c: Ignore all client events that
+ were sent to a window that we don't know about or
+ to a foreign window. (#81543, Young-Ho, Cha)
+
Thu Jun 13 12:24:09 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_set_filename):
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 95eec2c2b..1ff7a343f 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,9 @@
+Thu Jun 13 15:02:49 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkdnd-x11.c: Ignore all client events that
+ were sent to a window that we don't know about or
+ to a foreign window. (#81543, Young-Ho, Cha)
+
Thu Jun 13 12:24:09 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_set_filename):
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 95eec2c2b..1ff7a343f 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,9 @@
+Thu Jun 13 15:02:49 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkdnd-x11.c: Ignore all client events that
+ were sent to a window that we don't know about or
+ to a foreign window. (#81543, Young-Ho, Cha)
+
Thu Jun 13 12:24:09 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_set_filename):
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 95eec2c2b..1ff7a343f 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,9 @@
+Thu Jun 13 15:02:49 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkdnd-x11.c: Ignore all client events that
+ were sent to a window that we don't know about or
+ to a foreign window. (#81543, Young-Ho, Cha)
+
Thu Jun 13 12:24:09 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_set_filename):
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index e590cfd76..99cb9e08a 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -1770,6 +1770,10 @@ motif_dnd_filter (GdkXEvent *xev,
Atom atom;
gint16 x_root, y_root;
gboolean is_reply;
+
+ if (!event->any.window ||
+ gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
+ return GDK_FILTER_CONTINUE; /* Not for us */
/* First read some fields common to all Motif DND messages */
@@ -1910,15 +1914,16 @@ xdnd_status_filter (GdkXEvent *xev,
guint32 flags = xevent->xclient.data.l[1];
Atom action = xevent->xclient.data.l[4];
GdkDragContext *context;
+
+ if (!event->any.window ||
+ gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
+ return GDK_FILTER_CONTINUE; /* Not for us */
GDK_NOTE (DND,
g_message ("XdndStatus: dest_window: %#x action: %ld",
dest_window, action));
display = gdk_drawable_get_display (event->any.window);
- if (!display)
- return GDK_FILTER_REMOVE;
-
context = gdk_drag_context_find (display, TRUE, xevent->xclient.window, dest_window);
if (context)
@@ -1957,14 +1962,15 @@ xdnd_finished_filter (GdkXEvent *xev,
XEvent *xevent = (XEvent *)xev;
guint32 dest_window = xevent->xclient.data.l[0];
GdkDragContext *context;
+
+ if (!event->any.window ||
+ gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
+ return GDK_FILTER_CONTINUE; /* Not for us */
GDK_NOTE (DND,
g_message ("XdndFinished: dest_window: %#x", dest_window));
display = gdk_drawable_get_display (event->any.window);
- if (!display)
- return GDK_FILTER_REMOVE;
-
context = gdk_drag_context_find (display, TRUE, xevent->xclient.window, dest_window);
if (context)
@@ -2417,8 +2423,8 @@ xdnd_enter_filter (GdkXEvent *xev,
GdkEvent *event,
gpointer cb_data)
{
- GdkDisplay *display = GDK_DRAWABLE_DISPLAY (event->any.window);
- GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
+ GdkDisplay *display;
+ GdkDisplayX11 *display_x11;
XEvent *xevent = (XEvent *)xev;
GdkDragContext *new_context;
gint i;
@@ -2428,10 +2434,21 @@ xdnd_enter_filter (GdkXEvent *xev,
gulong nitems, after;
Atom *data;
- guint32 source_window = xevent->xclient.data.l[0];
- gboolean get_types = ((xevent->xclient.data.l[1] & 1) != 0);
- gint version = (xevent->xclient.data.l[1] & 0xff000000) >> 24;
+ guint32 source_window;
+ gboolean get_types;
+ gint version;
+
+ if (!event->any.window ||
+ gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
+ return GDK_FILTER_CONTINUE; /* Not for us */
+
+ source_window = xevent->xclient.data.l[0];
+ get_types = ((xevent->xclient.data.l[1] & 1) != 0);
+ version = (xevent->xclient.data.l[1] & 0xff000000) >> 24;
+ display = GDK_DRAWABLE_DISPLAY (event->any.window);
+ display_x11 = GDK_DISPLAY_X11 (display);
+
GDK_NOTE (DND,
g_message ("XdndEnter: source_window: %#x, version: %#x",
source_window, version));
@@ -2529,12 +2546,18 @@ xdnd_leave_filter (GdkXEvent *xev,
{
XEvent *xevent = (XEvent *)xev;
guint32 source_window = xevent->xclient.data.l[0];
- GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (GDK_DRAWABLE_DISPLAY (event->any.window));
+ GdkDisplayX11 *display_x11;
+ if (!event->any.window ||
+ gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
+ return GDK_FILTER_CONTINUE; /* Not for us */
+
GDK_NOTE (DND,
g_message ("XdndLeave: source_window: %#x",
source_window));
+ display_x11 = GDK_DISPLAY_X11 (GDK_DRAWABLE_DISPLAY (event->any.window));
+
if ((display_x11->current_dest_drag != NULL) &&
(display_x11->current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
(GDK_DRAWABLE_XID (display_x11->current_dest_drag->source_window) == source_window))
@@ -2563,13 +2586,19 @@ xdnd_position_filter (GdkXEvent *xev,
guint32 time = xevent->xclient.data.l[3];
Atom action = xevent->xclient.data.l[4];
- GdkDisplay *display = GDK_DRAWABLE_DISPLAY (event->any.window);
- GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
+ GdkDisplay *display;
+ GdkDisplayX11 *display_x11;
+ if (!event->any.window ||
+ gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
+ return GDK_FILTER_CONTINUE; /* Not for us */
+
GDK_NOTE (DND,
g_message ("XdndPosition: source_window: %#x position: (%d, %d) time: %d action: %ld",
source_window, x_root, y_root, time, action));
+ display = GDK_DRAWABLE_DISPLAY (event->any.window);
+ display_x11 = GDK_DISPLAY_X11 (display);
if ((display_x11->current_dest_drag != NULL) &&
(display_x11->current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
@@ -2606,12 +2635,18 @@ xdnd_drop_filter (GdkXEvent *xev,
XEvent *xevent = (XEvent *)xev;
guint32 source_window = xevent->xclient.data.l[0];
guint32 time = xevent->xclient.data.l[2];
- GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (GDK_DRAWABLE_DISPLAY (event->any.window));
+ GdkDisplayX11 *display_x11;
+
+ if (!event->any.window ||
+ gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
+ return GDK_FILTER_CONTINUE; /* Not for us */
GDK_NOTE (DND,
g_message ("XdndDrop: source_window: %#x time: %d",
source_window, time));
+ display_x11 = GDK_DISPLAY_X11 (GDK_DRAWABLE_DISPLAY (event->any.window));
+
if ((display_x11->current_dest_drag != NULL) &&
(display_x11->current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
(GDK_DRAWABLE_XID (display_x11->current_dest_drag->source_window) == source_window))