Commit 3b8aea38 authored by Benjamin Otte's avatar Benjamin Otte

x11: Use window macros instead of drawable macros

GDK_WINDOW_XID() instead of GDK_DRAWABLE_XID()
GDK_WINDOW_XDISPLAY() instead of GDK_DRAWABLE_XDISPLAY()
parent 91679c38
...@@ -133,8 +133,8 @@ gdk_device_core_get_history (GdkDevice *device, ...@@ -133,8 +133,8 @@ gdk_device_core_get_history (GdkDevice *device,
int i, j; int i, j;
impl_window = _gdk_window_get_impl_window (window); impl_window = _gdk_window_get_impl_window (window);
xcoords = XGetMotionEvents (GDK_DRAWABLE_XDISPLAY (window), xcoords = XGetMotionEvents (GDK_WINDOW_XDISPLAY (window),
GDK_DRAWABLE_XID (impl_window), GDK_WINDOW_XID (impl_window),
start, stop, &tmp_n_events); start, stop, &tmp_n_events);
if (!xcoords) if (!xcoords)
return FALSE; return FALSE;
......
...@@ -726,8 +726,8 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator, ...@@ -726,8 +726,8 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
Window child_window = 0; Window child_window = 0;
gdk_error_trap_push (); gdk_error_trap_push ();
if (XTranslateCoordinates (GDK_DRAWABLE_XDISPLAY (window), if (XTranslateCoordinates (GDK_WINDOW_XDISPLAY (window),
GDK_DRAWABLE_XID (window), GDK_WINDOW_XID (window),
screen_x11->xroot_window, screen_x11->xroot_window,
0, 0, 0, 0,
&tx, &ty, &tx, &ty,
......
...@@ -294,12 +294,12 @@ gdk_drag_context_find (GdkDisplay *display, ...@@ -294,12 +294,12 @@ gdk_drag_context_find (GdkDisplay *display,
context_dest_xid = context->dest_window ? context_dest_xid = context->dest_window ?
(private->drop_xid ? (private->drop_xid ?
private->drop_xid : private->drop_xid :
GDK_DRAWABLE_XID (context->dest_window)) : GDK_WINDOW_XID (context->dest_window)) :
None; None;
if ((!context->is_source == !is_source) && if ((!context->is_source == !is_source) &&
((source_xid == None) || (context->source_window && ((source_xid == None) || (context->source_window &&
(GDK_DRAWABLE_XID (context->source_window) == source_xid))) && (GDK_WINDOW_XID (context->source_window) == source_xid))) &&
((dest_xid == None) || (context_dest_xid == dest_xid))) ((dest_xid == None) || (context_dest_xid == dest_xid)))
return context; return context;
...@@ -1405,8 +1405,8 @@ motif_set_targets (GdkDragContext *context) ...@@ -1405,8 +1405,8 @@ motif_set_targets (GdkDragContext *context)
info.selection_atom = private->motif_selection; info.selection_atom = private->motif_selection;
XChangeProperty (GDK_DRAWABLE_XDISPLAY (context->source_window), XChangeProperty (GDK_WINDOW_XDISPLAY (context->source_window),
GDK_DRAWABLE_XID (context->source_window), GDK_WINDOW_XID (context->source_window),
private->motif_selection, private->motif_selection,
gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_INITIATOR_INFO"), gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_INITIATOR_INFO"),
8, PropModeReplace, 8, PropModeReplace,
...@@ -1475,13 +1475,13 @@ motif_send_enter (GdkDragContext *context, ...@@ -1475,13 +1475,13 @@ motif_send_enter (GdkDragContext *context,
xev.xclient.type = ClientMessage; xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_AND_DROP_MESSAGE"); xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_AND_DROP_MESSAGE");
xev.xclient.format = 8; xev.xclient.format = 8;
xev.xclient.window = GDK_DRAWABLE_XID (context->dest_window); xev.xclient.window = GDK_WINDOW_XID (context->dest_window);
MOTIF_XCLIENT_BYTE (&xev, 0) = XmTOP_LEVEL_ENTER; MOTIF_XCLIENT_BYTE (&xev, 0) = XmTOP_LEVEL_ENTER;
MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order; MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order;
MOTIF_XCLIENT_SHORT (&xev, 1) = 0; MOTIF_XCLIENT_SHORT (&xev, 1) = 0;
MOTIF_XCLIENT_LONG (&xev, 1) = time; MOTIF_XCLIENT_LONG (&xev, 1) = time;
MOTIF_XCLIENT_LONG (&xev, 2) = GDK_DRAWABLE_XID (context->source_window); MOTIF_XCLIENT_LONG (&xev, 2) = GDK_WINDOW_XID (context->source_window);
if (!private->motif_targets_set) if (!private->motif_targets_set)
motif_set_targets (context); motif_set_targets (context);
...@@ -1490,11 +1490,11 @@ motif_send_enter (GdkDragContext *context, ...@@ -1490,11 +1490,11 @@ motif_send_enter (GdkDragContext *context,
MOTIF_XCLIENT_LONG (&xev, 4) = 0; MOTIF_XCLIENT_LONG (&xev, 4) = 0;
if (!_gdk_send_xevent (display, if (!_gdk_send_xevent (display,
GDK_DRAWABLE_XID (context->dest_window), GDK_WINDOW_XID (context->dest_window),
FALSE, 0, &xev)) FALSE, 0, &xev))
GDK_NOTE (DND, GDK_NOTE (DND,
g_message ("Send event to %lx failed", g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->dest_window))); GDK_WINDOW_XID (context->dest_window)));
} }
static void static void
...@@ -1507,7 +1507,7 @@ motif_send_leave (GdkDragContext *context, ...@@ -1507,7 +1507,7 @@ motif_send_leave (GdkDragContext *context,
xev.xclient.type = ClientMessage; xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_AND_DROP_MESSAGE"); xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_AND_DROP_MESSAGE");
xev.xclient.format = 8; xev.xclient.format = 8;
xev.xclient.window = GDK_DRAWABLE_XID (context->dest_window); xev.xclient.window = GDK_WINDOW_XID (context->dest_window);
MOTIF_XCLIENT_BYTE (&xev, 0) = XmTOP_LEVEL_LEAVE; MOTIF_XCLIENT_BYTE (&xev, 0) = XmTOP_LEVEL_LEAVE;
MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order; MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order;
...@@ -1518,11 +1518,11 @@ motif_send_leave (GdkDragContext *context, ...@@ -1518,11 +1518,11 @@ motif_send_leave (GdkDragContext *context,
MOTIF_XCLIENT_LONG (&xev, 4) = 0; MOTIF_XCLIENT_LONG (&xev, 4) = 0;
if (!_gdk_send_xevent (display, if (!_gdk_send_xevent (display,
GDK_DRAWABLE_XID (context->dest_window), GDK_WINDOW_XID (context->dest_window),
FALSE, 0, &xev)) FALSE, 0, &xev))
GDK_NOTE (DND, GDK_NOTE (DND,
g_message ("Send event to %lx failed", g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->dest_window))); GDK_WINDOW_XID (context->dest_window)));
} }
static gboolean static gboolean
...@@ -1540,7 +1540,7 @@ motif_send_motion (GdkDragContext *context, ...@@ -1540,7 +1540,7 @@ motif_send_motion (GdkDragContext *context,
xev.xclient.type = ClientMessage; xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_AND_DROP_MESSAGE"); xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_AND_DROP_MESSAGE");
xev.xclient.format = 8; xev.xclient.format = 8;
xev.xclient.window = GDK_DRAWABLE_XID (context->dest_window); xev.xclient.window = GDK_WINDOW_XID (context->dest_window);
MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order; MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order;
MOTIF_XCLIENT_SHORT (&xev, 1) = motif_dnd_get_flags (context); MOTIF_XCLIENT_SHORT (&xev, 1) = motif_dnd_get_flags (context);
...@@ -1568,11 +1568,11 @@ motif_send_motion (GdkDragContext *context, ...@@ -1568,11 +1568,11 @@ motif_send_motion (GdkDragContext *context,
} }
if (!_gdk_send_xevent (display, if (!_gdk_send_xevent (display,
GDK_DRAWABLE_XID (context->dest_window), GDK_WINDOW_XID (context->dest_window),
FALSE, 0, &xev)) FALSE, 0, &xev))
GDK_NOTE (DND, GDK_NOTE (DND,
g_message ("Send event to %lx failed", g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->dest_window))); GDK_WINDOW_XID (context->dest_window)));
return retval; return retval;
} }
...@@ -1587,7 +1587,7 @@ motif_send_drop (GdkDragContext *context, guint32 time) ...@@ -1587,7 +1587,7 @@ motif_send_drop (GdkDragContext *context, guint32 time)
xev.xclient.type = ClientMessage; xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_AND_DROP_MESSAGE"); xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_AND_DROP_MESSAGE");
xev.xclient.format = 8; xev.xclient.format = 8;
xev.xclient.window = GDK_DRAWABLE_XID (context->dest_window); xev.xclient.window = GDK_WINDOW_XID (context->dest_window);
MOTIF_XCLIENT_BYTE (&xev, 0) = XmDROP_START; MOTIF_XCLIENT_BYTE (&xev, 0) = XmDROP_START;
MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order; MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order;
...@@ -1598,14 +1598,14 @@ motif_send_drop (GdkDragContext *context, guint32 time) ...@@ -1598,14 +1598,14 @@ motif_send_drop (GdkDragContext *context, guint32 time)
MOTIF_XCLIENT_SHORT (&xev, 5) = private->last_y; MOTIF_XCLIENT_SHORT (&xev, 5) = private->last_y;
MOTIF_XCLIENT_LONG (&xev, 3) = private->motif_selection; MOTIF_XCLIENT_LONG (&xev, 3) = private->motif_selection;
MOTIF_XCLIENT_LONG (&xev, 4) = GDK_DRAWABLE_XID (context->source_window); MOTIF_XCLIENT_LONG (&xev, 4) = GDK_WINDOW_XID (context->source_window);
if (!_gdk_send_xevent (display, if (!_gdk_send_xevent (display,
GDK_DRAWABLE_XID (context->dest_window), GDK_WINDOW_XID (context->dest_window),
FALSE, 0, &xev)) FALSE, 0, &xev))
GDK_NOTE (DND, GDK_NOTE (DND,
g_message ("Send event to %lx failed", g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->dest_window))); GDK_WINDOW_XID (context->dest_window)));
} }
/* Target Side */ /* Target Side */
...@@ -1924,7 +1924,7 @@ motif_drag_status (GdkEvent *event, ...@@ -1924,7 +1924,7 @@ motif_drag_status (GdkEvent *event,
if (!display) if (!display)
return GDK_FILTER_REMOVE; return GDK_FILTER_REMOVE;
context = gdk_drag_context_find (display, TRUE, GDK_DRAWABLE_XID (event->any.window), None); context = gdk_drag_context_find (display, TRUE, GDK_WINDOW_XID (event->any.window), None);
if (context) if (context)
{ {
...@@ -2228,8 +2228,8 @@ xdnd_set_targets (GdkDragContext *context) ...@@ -2228,8 +2228,8 @@ xdnd_set_targets (GdkDragContext *context)
i++; i++;
} }
XChangeProperty (GDK_DRAWABLE_XDISPLAY (context->source_window), XChangeProperty (GDK_WINDOW_XDISPLAY (context->source_window),
GDK_DRAWABLE_XID (context->source_window), GDK_WINDOW_XID (context->source_window),
gdk_x11_get_xatom_by_name_for_display (display, "XdndTypeList"), gdk_x11_get_xatom_by_name_for_display (display, "XdndTypeList"),
XA_ATOM, 32, PropModeReplace, XA_ATOM, 32, PropModeReplace,
(guchar *)atomlist, n_atoms); (guchar *)atomlist, n_atoms);
...@@ -2277,8 +2277,8 @@ xdnd_set_actions (GdkDragContext *context) ...@@ -2277,8 +2277,8 @@ xdnd_set_actions (GdkDragContext *context)
} }
} }
XChangeProperty (GDK_DRAWABLE_XDISPLAY (context->source_window), XChangeProperty (GDK_WINDOW_XDISPLAY (context->source_window),
GDK_DRAWABLE_XID (context->source_window), GDK_WINDOW_XID (context->source_window),
gdk_x11_get_xatom_by_name_for_display (display, "XdndActionList"), gdk_x11_get_xatom_by_name_for_display (display, "XdndActionList"),
XA_ATOM, 32, PropModeReplace, XA_ATOM, 32, PropModeReplace,
(guchar *)atomlist, n_atoms); (guchar *)atomlist, n_atoms);
...@@ -2422,8 +2422,8 @@ xdnd_send_enter (GdkDragContext *context) ...@@ -2422,8 +2422,8 @@ xdnd_send_enter (GdkDragContext *context)
xev.xclient.format = 32; xev.xclient.format = 32;
xev.xclient.window = private->drop_xid ? xev.xclient.window = private->drop_xid ?
private->drop_xid : private->drop_xid :
GDK_DRAWABLE_XID (context->dest_window); GDK_WINDOW_XID (context->dest_window);
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->source_window); xev.xclient.data.l[0] = GDK_WINDOW_XID (context->source_window);
xev.xclient.data.l[1] = (private->version << 24); /* version */ xev.xclient.data.l[1] = (private->version << 24); /* version */
xev.xclient.data.l[2] = 0; xev.xclient.data.l[2] = 0;
xev.xclient.data.l[3] = 0; xev.xclient.data.l[3] = 0;
...@@ -2431,7 +2431,7 @@ xdnd_send_enter (GdkDragContext *context) ...@@ -2431,7 +2431,7 @@ xdnd_send_enter (GdkDragContext *context)
GDK_NOTE(DND, GDK_NOTE(DND,
g_message ("Sending enter source window %#lx XDND protocol version %d\n", g_message ("Sending enter source window %#lx XDND protocol version %d\n",
GDK_DRAWABLE_XID (context->source_window), private->version)); GDK_WINDOW_XID (context->source_window), private->version));
if (g_list_length (context->targets) > 3) if (g_list_length (context->targets) > 3)
{ {
if (!private->xdnd_targets_set) if (!private->xdnd_targets_set)
...@@ -2457,7 +2457,7 @@ xdnd_send_enter (GdkDragContext *context) ...@@ -2457,7 +2457,7 @@ xdnd_send_enter (GdkDragContext *context)
{ {
GDK_NOTE (DND, GDK_NOTE (DND,
g_message ("Send event to %lx failed", g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->dest_window))); GDK_WINDOW_XID (context->dest_window)));
g_object_unref (context->dest_window); g_object_unref (context->dest_window);
context->dest_window = NULL; context->dest_window = NULL;
} }
...@@ -2476,8 +2476,8 @@ xdnd_send_leave (GdkDragContext *context) ...@@ -2476,8 +2476,8 @@ xdnd_send_leave (GdkDragContext *context)
xev.xclient.format = 32; xev.xclient.format = 32;
xev.xclient.window = private->drop_xid ? xev.xclient.window = private->drop_xid ?
private->drop_xid : private->drop_xid :
GDK_DRAWABLE_XID (context->dest_window); GDK_WINDOW_XID (context->dest_window);
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->source_window); xev.xclient.data.l[0] = GDK_WINDOW_XID (context->source_window);
xev.xclient.data.l[1] = 0; xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = 0; xev.xclient.data.l[2] = 0;
xev.xclient.data.l[3] = 0; xev.xclient.data.l[3] = 0;
...@@ -2488,7 +2488,7 @@ xdnd_send_leave (GdkDragContext *context) ...@@ -2488,7 +2488,7 @@ xdnd_send_leave (GdkDragContext *context)
{ {
GDK_NOTE (DND, GDK_NOTE (DND,
g_message ("Send event to %lx failed", g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->dest_window))); GDK_WINDOW_XID (context->dest_window)));
g_object_unref (context->dest_window); g_object_unref (context->dest_window);
context->dest_window = NULL; context->dest_window = NULL;
} }
...@@ -2506,8 +2506,8 @@ xdnd_send_drop (GdkDragContext *context, guint32 time) ...@@ -2506,8 +2506,8 @@ xdnd_send_drop (GdkDragContext *context, guint32 time)
xev.xclient.format = 32; xev.xclient.format = 32;
xev.xclient.window = private->drop_xid ? xev.xclient.window = private->drop_xid ?
private->drop_xid : private->drop_xid :
GDK_DRAWABLE_XID (context->dest_window); GDK_WINDOW_XID (context->dest_window);
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->source_window); xev.xclient.data.l[0] = GDK_WINDOW_XID (context->source_window);
xev.xclient.data.l[1] = 0; xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = time; xev.xclient.data.l[2] = time;
xev.xclient.data.l[3] = 0; xev.xclient.data.l[3] = 0;
...@@ -2518,7 +2518,7 @@ xdnd_send_drop (GdkDragContext *context, guint32 time) ...@@ -2518,7 +2518,7 @@ xdnd_send_drop (GdkDragContext *context, guint32 time)
{ {
GDK_NOTE (DND, GDK_NOTE (DND,
g_message ("Send event to %lx failed", g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->dest_window))); GDK_WINDOW_XID (context->dest_window)));
g_object_unref (context->dest_window); g_object_unref (context->dest_window);
context->dest_window = NULL; context->dest_window = NULL;
} }
...@@ -2540,8 +2540,8 @@ xdnd_send_motion (GdkDragContext *context, ...@@ -2540,8 +2540,8 @@ xdnd_send_motion (GdkDragContext *context,
xev.xclient.format = 32; xev.xclient.format = 32;
xev.xclient.window = private->drop_xid ? xev.xclient.window = private->drop_xid ?
private->drop_xid : private->drop_xid :
GDK_DRAWABLE_XID (context->dest_window); GDK_WINDOW_XID (context->dest_window);
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->source_window); xev.xclient.data.l[0] = GDK_WINDOW_XID (context->source_window);
xev.xclient.data.l[1] = 0; xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = (x_root << 16) | y_root; xev.xclient.data.l[2] = (x_root << 16) | y_root;
xev.xclient.data.l[3] = time; xev.xclient.data.l[3] = time;
...@@ -2552,7 +2552,7 @@ xdnd_send_motion (GdkDragContext *context, ...@@ -2552,7 +2552,7 @@ xdnd_send_motion (GdkDragContext *context,
{ {
GDK_NOTE (DND, GDK_NOTE (DND,
g_message ("Send event to %lx failed", g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->dest_window))); GDK_WINDOW_XID (context->dest_window)));
g_object_unref (context->dest_window); g_object_unref (context->dest_window);
context->dest_window = NULL; context->dest_window = NULL;
} }
...@@ -2654,7 +2654,7 @@ xdnd_read_actions (GdkDragContext *context) ...@@ -2654,7 +2654,7 @@ xdnd_read_actions (GdkDragContext *context)
gdk_error_trap_push (); gdk_error_trap_push ();
if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_DRAWABLE_XID (context->source_window), GDK_WINDOW_XID (context->source_window),
gdk_x11_get_xatom_by_name_for_display (display, "XdndActionList"), gdk_x11_get_xatom_by_name_for_display (display, "XdndActionList"),
0, 65536, 0, 65536,
False, XA_ATOM, &type, &format, &nitems, False, XA_ATOM, &type, &format, &nitems,
...@@ -2702,8 +2702,8 @@ xdnd_read_actions (GdkDragContext *context) ...@@ -2702,8 +2702,8 @@ xdnd_read_actions (GdkDragContext *context)
GdkDragContext *source_context; GdkDragContext *source_context;
source_context = gdk_drag_context_find (display, TRUE, source_context = gdk_drag_context_find (display, TRUE,
GDK_DRAWABLE_XID (context->source_window), GDK_WINDOW_XID (context->source_window),
GDK_DRAWABLE_XID (context->dest_window)); GDK_WINDOW_XID (context->dest_window));
if (source_context) if (source_context)
{ {
...@@ -2903,7 +2903,7 @@ xdnd_enter_filter (GdkXEvent *xev, ...@@ -2903,7 +2903,7 @@ xdnd_enter_filter (GdkXEvent *xev,
if (get_types) if (get_types)
{ {
gdk_error_trap_push (); gdk_error_trap_push ();
XGetWindowProperty (GDK_DRAWABLE_XDISPLAY (event->any.window), XGetWindowProperty (GDK_WINDOW_XDISPLAY (event->any.window),
source_window, source_window,
gdk_x11_get_xatom_by_name_for_display (display, "XdndTypeList"), gdk_x11_get_xatom_by_name_for_display (display, "XdndTypeList"),
0, 65536, 0, 65536,
...@@ -2983,7 +2983,7 @@ xdnd_leave_filter (GdkXEvent *xev, ...@@ -2983,7 +2983,7 @@ xdnd_leave_filter (GdkXEvent *xev,
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_WINDOW_XID (display_x11->current_dest_drag->source_window) == source_window))
{ {
event->dnd.type = GDK_DRAG_LEAVE; event->dnd.type = GDK_DRAG_LEAVE;
/* Pass ownership of context to the event */ /* Pass ownership of context to the event */
...@@ -3028,7 +3028,7 @@ xdnd_position_filter (GdkXEvent *xev, ...@@ -3028,7 +3028,7 @@ xdnd_position_filter (GdkXEvent *xev,
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_WINDOW_XID (display_x11->current_dest_drag->source_window) == source_window))
{ {
event->dnd.type = GDK_DRAG_MOTION; event->dnd.type = GDK_DRAG_MOTION;
event->dnd.context = display_x11->current_dest_drag; event->dnd.context = display_x11->current_dest_drag;
...@@ -3080,7 +3080,7 @@ xdnd_drop_filter (GdkXEvent *xev, ...@@ -3080,7 +3080,7 @@ xdnd_drop_filter (GdkXEvent *xev,
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_WINDOW_XID (display_x11->current_dest_drag->source_window) == source_window))
{ {
GdkDragContextPrivateX11 *private; GdkDragContextPrivateX11 *private;
private = PRIVATE_DATA (display_x11->current_dest_drag); private = PRIVATE_DATA (display_x11->current_dest_drag);
...@@ -3386,7 +3386,7 @@ gdk_drag_find_window_for_screen (GdkDragContext *context, ...@@ -3386,7 +3386,7 @@ gdk_drag_find_window_for_screen (GdkDragContext *context,
dest = get_client_window_at_coords (window_cache, dest = get_client_window_at_coords (window_cache,
drag_window && GDK_WINDOW_IS_X11 (drag_window) ? drag_window && GDK_WINDOW_IS_X11 (drag_window) ?
GDK_DRAWABLE_XID (drag_window) : None, GDK_WINDOW_XID (drag_window) : None,
x_root, y_root); x_root, y_root);
if (private->dest_xid != dest) if (private->dest_xid != dest)
...@@ -3478,7 +3478,7 @@ gdk_drag_motion (GdkDragContext *context, ...@@ -3478,7 +3478,7 @@ gdk_drag_motion (GdkDragContext *context,
GdkDisplay *display = GDK_WINDOW_DISPLAY (dest_window); GdkDisplay *display = GDK_WINDOW_DISPLAY (dest_window);
xdnd_check_dest (display, xdnd_check_dest (display,
GDK_DRAWABLE_XID (dest_window), GDK_WINDOW_XID (dest_window),
&private->version); &private->version);
} }
} }
...@@ -3498,8 +3498,8 @@ gdk_drag_motion (GdkDragContext *context, ...@@ -3498,8 +3498,8 @@ gdk_drag_motion (GdkDragContext *context,
GdkDragContext *dest_context; GdkDragContext *dest_context;
dest_context = gdk_drag_context_find (display, FALSE, dest_context = gdk_drag_context_find (display, FALSE,
GDK_DRAWABLE_XID (context->source_window), GDK_WINDOW_XID (context->source_window),
GDK_DRAWABLE_XID (dest_window)); GDK_WINDOW_XID (dest_window));
if (dest_context) if (dest_context)
{ {
...@@ -3733,7 +3733,7 @@ gdk_drag_status (GdkDragContext *context, ...@@ -3733,7 +3733,7 @@ gdk_drag_status (GdkDragContext *context,
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display,
"_MOTIF_DRAG_AND_DROP_MESSAGE"); "_MOTIF_DRAG_AND_DROP_MESSAGE");
xev.xclient.format = 8; xev.xclient.format = 8;
xev.xclient.window = GDK_DRAWABLE_XID (context->source_window); xev.xclient.window = GDK_WINDOW_XID (context->source_window);
if (private->drag_status == GDK_DRAG_STATUS_ACTION_WAIT) if (private->drag_status == GDK_DRAG_STATUS_ACTION_WAIT)
{ {
...@@ -3795,20 +3795,20 @@ gdk_drag_status (GdkDragContext *context, ...@@ -3795,20 +3795,20 @@ gdk_drag_status (GdkDragContext *context,
MOTIF_XCLIENT_LONG (&xev, 4) = 0; MOTIF_XCLIENT_LONG (&xev, 4) = 0;
if (!_gdk_send_xevent (display, if (!_gdk_send_xevent (display,
GDK_DRAWABLE_XID (context->source_window), GDK_WINDOW_XID (context->source_window),
FALSE, 0, &xev)) FALSE, 0, &xev))
GDK_NOTE (DND, GDK_NOTE (DND,
g_message ("Send event to %lx failed", g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->source_window))); GDK_WINDOW_XID (context->source_window)));
} }
else if (context->protocol == GDK_DRAG_PROTO_XDND) else if (context->protocol == GDK_DRAG_PROTO_XDND)
{ {
xev.xclient.type = ClientMessage; xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "XdndStatus"); xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "XdndStatus");
xev.xclient.format = 32; xev.xclient.format = 32;
xev.xclient.window = GDK_DRAWABLE_XID (context->source_window); xev.xclient.window = GDK_WINDOW_XID (context->source_window);
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->dest_window); xev.xclient.data.l[0] = GDK_WINDOW_XID (context->dest_window);
xev.xclient.data.l[1] = (action != 0) ? (2 | 1) : 0; xev.xclient.data.l[1] = (action != 0) ? (2 | 1) : 0;
xev.xclient.data.l[2] = 0; xev.xclient.data.l[2] = 0;
xev.xclient.data.l[3] = 0; xev.xclient.data.l[3] = 0;
...@@ -3818,7 +3818,7 @@ gdk_drag_status (GdkDragContext *context, ...@@ -3818,7 +3818,7 @@ gdk_drag_status (GdkDragContext *context,
FALSE, &xev)) FALSE, &xev))
GDK_NOTE (DND, GDK_NOTE (DND,
g_message ("Send event to %lx failed", g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->source_window))); GDK_WINDOW_XID (context->source_window)));
} }
private->old_action = action; private->old_action = action;
...@@ -3875,7 +3875,7 @@ gdk_drop_reply (GdkDragContext *context, ...@@ -3875,7 +3875,7 @@ gdk_drop_reply (GdkDragContext *context,
MOTIF_XCLIENT_LONG (&xev, 4) = 0; MOTIF_XCLIENT_LONG (&xev, 4) = 0;
_gdk_send_xevent (display, _gdk_send_xevent (display,
GDK_DRAWABLE_XID (context->source_window), GDK_WINDOW_XID (context->source_window),
FALSE, 0, &xev); FALSE, 0, &xev);
} }
} }
...@@ -3905,9 +3905,9 @@ gdk_drop_finish (GdkDragContext *context, ...@@ -3905,9 +3905,9 @@ gdk_drop_finish (GdkDragContext *context,
xev.xclient.type = ClientMessage; xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "XdndFinished"); xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "XdndFinished");
xev.xclient.format = 32; xev.xclient.format = 32;
xev.xclient.window = GDK_DRAWABLE_XID (context->source_window); xev.xclient.window = GDK_WINDOW_XID (context->source_window);
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->dest_window); xev.xclient.data.l[0] = GDK_WINDOW_XID (context->dest_window);
if (success) if (success)
{ {