Commit 8d797952 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor
Browse files

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)
parent 16fc6b1a
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> Thu Jun 13 12:24:09 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_set_filename): * gtk/gtkfilesel.c (gtk_file_selection_set_filename):
......
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> Thu Jun 13 12:24:09 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_set_filename): * gtk/gtkfilesel.c (gtk_file_selection_set_filename):
......
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> Thu Jun 13 12:24:09 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_set_filename): * gtk/gtkfilesel.c (gtk_file_selection_set_filename):
......
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> Thu Jun 13 12:24:09 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_set_filename): * gtk/gtkfilesel.c (gtk_file_selection_set_filename):
......
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> Thu Jun 13 12:24:09 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_set_filename): * gtk/gtkfilesel.c (gtk_file_selection_set_filename):
......
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> Thu Jun 13 12:24:09 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_set_filename): * gtk/gtkfilesel.c (gtk_file_selection_set_filename):
......
...@@ -1770,6 +1770,10 @@ motif_dnd_filter (GdkXEvent *xev, ...@@ -1770,6 +1770,10 @@ motif_dnd_filter (GdkXEvent *xev,
Atom atom; Atom atom;
gint16 x_root, y_root; gint16 x_root, y_root;
gboolean is_reply; 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 */ /* First read some fields common to all Motif DND messages */
...@@ -1910,15 +1914,16 @@ xdnd_status_filter (GdkXEvent *xev, ...@@ -1910,15 +1914,16 @@ xdnd_status_filter (GdkXEvent *xev,
guint32 flags = xevent->xclient.data.l[1]; guint32 flags = xevent->xclient.data.l[1];
Atom action = xevent->xclient.data.l[4]; Atom action = xevent->xclient.data.l[4];
GdkDragContext *context; 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, GDK_NOTE (DND,
g_message ("XdndStatus: dest_window: %#x action: %ld", g_message ("XdndStatus: dest_window: %#x action: %ld",
dest_window, action)); dest_window, action));
display = gdk_drawable_get_display (event->any.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); context = gdk_drag_context_find (display, TRUE, xevent->xclient.window, dest_window);
if (context) if (context)
...@@ -1957,14 +1962,15 @@ xdnd_finished_filter (GdkXEvent *xev, ...@@ -1957,14 +1962,15 @@ xdnd_finished_filter (GdkXEvent *xev,
XEvent *xevent = (XEvent *)xev; XEvent *xevent = (XEvent *)xev;
guint32 dest_window = xevent->xclient.data.l[0]; guint32 dest_window = xevent->xclient.data.l[0];
GdkDragContext *context; 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, GDK_NOTE (DND,
g_message ("XdndFinished: dest_window: %#x", dest_window)); g_message ("XdndFinished: dest_window: %#x", dest_window));
display = gdk_drawable_get_display (event->any.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); context = gdk_drag_context_find (display, TRUE, xevent->xclient.window, dest_window);
if (context) if (context)
...@@ -2417,8 +2423,8 @@ xdnd_enter_filter (GdkXEvent *xev, ...@@ -2417,8 +2423,8 @@ xdnd_enter_filter (GdkXEvent *xev,
GdkEvent *event, GdkEvent *event,
gpointer cb_data) gpointer cb_data)
{ {
GdkDisplay *display = GDK_DRAWABLE_DISPLAY (event->any.window); GdkDisplay *display;
GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display); GdkDisplayX11 *display_x11;
XEvent *xevent = (XEvent *)xev; XEvent *xevent = (XEvent *)xev;
GdkDragContext *new_context; GdkDragContext *new_context;
gint i; gint i;
...@@ -2428,10 +2434,21 @@ xdnd_enter_filter (GdkXEvent *xev, ...@@ -2428,10 +2434,21 @@ xdnd_enter_filter (GdkXEvent *xev,
gulong nitems, after; gulong nitems, after;
Atom *data; Atom *data;
guint32 source_window = xevent->xclient.data.l[0]; guint32 source_window;
gboolean get_types = ((xevent->xclient.data.l[1] & 1) != 0); gboolean get_types;
gint version = (xevent->xclient.data.l[1] & 0xff000000) >> 24; 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, GDK_NOTE (DND,
g_message ("XdndEnter: source_window: %#x, version: %#x", g_message ("XdndEnter: source_window: %#x, version: %#x",
source_window, version)); source_window, version));
...@@ -2529,12 +2546,18 @@ xdnd_leave_filter (GdkXEvent *xev, ...@@ -2529,12 +2546,18 @@ xdnd_leave_filter (GdkXEvent *xev,
{ {
XEvent *xevent = (XEvent *)xev; XEvent *xevent = (XEvent *)xev;
guint32 source_window = xevent->xclient.data.l[0]; 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, GDK_NOTE (DND,
g_message ("XdndLeave: source_window: %#x", g_message ("XdndLeave: source_window: %#x",
source_window)); source_window));
display_x11 = GDK_DISPLAY_X11 (GDK_DRAWABLE_DISPLAY (event->any.window));
if ((display_x11->current_dest_drag != NULL) && if ((display_x11->current_dest_drag != NULL) &&
(display_x11->current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) && (display_x11->current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
(GDK_DRAWABLE_XID (display_x11->current_dest_drag->source_window) == source_window)) (GDK_DRAWABLE_XID (display_x11->current_dest_drag->source_window) == source_window))
...@@ -2563,13 +2586,19 @@ xdnd_position_filter (GdkXEvent *xev, ...@@ -2563,13 +2586,19 @@ xdnd_position_filter (GdkXEvent *xev,
guint32 time = xevent->xclient.data.l[3]; guint32 time = xevent->xclient.data.l[3];
Atom action = xevent->xclient.data.l[4]; Atom action = xevent->xclient.data.l[4];
GdkDisplay *display = GDK_DRAWABLE_DISPLAY (event->any.window); GdkDisplay *display;
GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (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, GDK_NOTE (DND,
g_message ("XdndPosition: source_window: %#x position: (%d, %d) time: %d action: %ld", g_message ("XdndPosition: source_window: %#x position: (%d, %d) time: %d action: %ld",
source_window, x_root, y_root, time, action)); 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) && if ((display_x11->current_dest_drag != NULL) &&
(display_x11->current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) && (display_x11->current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
...@@ -2606,12 +2635,18 @@ xdnd_drop_filter (GdkXEvent *xev, ...@@ -2606,12 +2635,18 @@ xdnd_drop_filter (GdkXEvent *xev,
XEvent *xevent = (XEvent *)xev; XEvent *xevent = (XEvent *)xev;
guint32 source_window = xevent->xclient.data.l[0]; guint32 source_window = xevent->xclient.data.l[0];
guint32 time = xevent->xclient.data.l[2]; 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, GDK_NOTE (DND,
g_message ("XdndDrop: source_window: %#x time: %d", g_message ("XdndDrop: source_window: %#x time: %d",
source_window, time)); source_window, time));
display_x11 = GDK_DISPLAY_X11 (GDK_DRAWABLE_DISPLAY (event->any.window));
if ((display_x11->current_dest_drag != NULL) && if ((display_x11->current_dest_drag != NULL) &&
(display_x11->current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) && (display_x11->current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
(GDK_DRAWABLE_XID (display_x11->current_dest_drag->source_window) == source_window)) (GDK_DRAWABLE_XID (display_x11->current_dest_drag->source_window) == source_window))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment