diff options
-rw-r--r-- | gdk/x11/gdkdisplay-x11.c | 2 | ||||
-rw-r--r-- | gdk/x11/gdkdnd-x11.c | 66 | ||||
-rw-r--r-- | gdk/x11/gdkmain-x11.c | 35 | ||||
-rw-r--r-- | gdk/x11/gdkprivate-x11.h | 10 | ||||
-rw-r--r-- | gdk/x11/gdkscreen-x11.c | 2 | ||||
-rw-r--r-- | gdk/x11/gdkselection-x11.c | 2 |
6 files changed, 51 insertions, 66 deletions
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index a3fefb992d..40bf45a225 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -2322,7 +2322,7 @@ gdk_x11_display_send_client_message (GdkDisplay *display, memcpy(&sev.xclient.data, &event->client.data, sizeof (sev.xclient.data)); sev.xclient.message_type = gdk_x11_atom_to_xatom_for_display (display, event->client.message_type); - return _gdk_send_xevent (display, winid, False, NoEventMask, &sev); + return _gdk_x11_display_send_xevent (display, winid, False, NoEventMask, &sev); } static void diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c index b321f3224c..50a1cb75f5 100644 --- a/gdk/x11/gdkdnd-x11.c +++ b/gdk/x11/gdkdnd-x11.c @@ -1449,12 +1449,12 @@ motif_send_enter (GdkDragContextX11 *context_x11, MOTIF_XCLIENT_LONG (&xev, 3) = context_x11->motif_selection; MOTIF_XCLIENT_LONG (&xev, 4) = 0; - if (!_gdk_send_xevent (display, - GDK_WINDOW_XID (context->dest_window), - FALSE, 0, &xev)) - GDK_NOTE (DND, - g_message ("Send event to %lx failed", - GDK_WINDOW_XID (context->dest_window))); + if (!_gdk_x11_display_send_xevent (display, + GDK_WINDOW_XID (context->dest_window), + FALSE, 0, &xev)) + GDK_NOTE (DND, + g_message ("Send event to %lx failed", + GDK_WINDOW_XID (context->dest_window))); } static void @@ -1478,12 +1478,12 @@ motif_send_leave (GdkDragContextX11 *context_x11, MOTIF_XCLIENT_LONG (&xev, 3) = 0; MOTIF_XCLIENT_LONG (&xev, 4) = 0; - if (!_gdk_send_xevent (display, - GDK_WINDOW_XID (context->dest_window), - FALSE, 0, &xev)) - GDK_NOTE (DND, - g_message ("Send event to %lx failed", - GDK_WINDOW_XID (context->dest_window))); + if (!_gdk_x11_display_send_xevent (display, + GDK_WINDOW_XID (context->dest_window), + FALSE, 0, &xev)) + GDK_NOTE (DND, + g_message ("Send event to %lx failed", + GDK_WINDOW_XID (context->dest_window))); } static gboolean @@ -1528,12 +1528,12 @@ motif_send_motion (GdkDragContextX11 *context_x11, retval = FALSE; } - if (!_gdk_send_xevent (display, - GDK_WINDOW_XID (context->dest_window), - FALSE, 0, &xev)) - GDK_NOTE (DND, - g_message ("Send event to %lx failed", - GDK_WINDOW_XID (context->dest_window))); + if (!_gdk_x11_display_send_xevent (display, + GDK_WINDOW_XID (context->dest_window), + FALSE, 0, &xev)) + GDK_NOTE (DND, + g_message ("Send event to %lx failed", + GDK_WINDOW_XID (context->dest_window))); return retval; } @@ -1562,12 +1562,12 @@ motif_send_drop (GdkDragContextX11 *context_x11, MOTIF_XCLIENT_LONG (&xev, 3) = context_x11->motif_selection; MOTIF_XCLIENT_LONG (&xev, 4) = GDK_WINDOW_XID (context->source_window); - if (!_gdk_send_xevent (display, - GDK_WINDOW_XID (context->dest_window), - FALSE, 0, &xev)) - GDK_NOTE (DND, - g_message ("Send event to %lx failed", - GDK_WINDOW_XID (context->dest_window))); + if (!_gdk_x11_display_send_xevent (display, + GDK_WINDOW_XID (context->dest_window), + FALSE, 0, &xev)) + GDK_NOTE (DND, + g_message ("Send event to %lx failed", + GDK_WINDOW_XID (context->dest_window))); } /* Target Side */ @@ -3613,12 +3613,12 @@ gdk_drag_context_x11_drag_status (GdkDragContext *context, MOTIF_XCLIENT_LONG (&xev, 3) = 0; MOTIF_XCLIENT_LONG (&xev, 4) = 0; - if (!_gdk_send_xevent (display, - GDK_WINDOW_XID (context->source_window), - FALSE, 0, &xev)) - GDK_NOTE (DND, - g_message ("Send event to %lx failed", - GDK_WINDOW_XID (context->source_window))); + if (!_gdk_x11_display_send_xevent (display, + GDK_WINDOW_XID (context->source_window), + FALSE, 0, &xev)) + GDK_NOTE (DND, + g_message ("Send event to %lx failed", + GDK_WINDOW_XID (context->source_window))); } else if (context->protocol == GDK_DRAG_PROTO_XDND) { @@ -3676,9 +3676,9 @@ gdk_drag_context_x11_drop_reply (GdkDragContext *context, MOTIF_XCLIENT_LONG (&xev, 3) = 0; MOTIF_XCLIENT_LONG (&xev, 4) = 0; - _gdk_send_xevent (display, - GDK_WINDOW_XID (context->source_window), - FALSE, 0, &xev); + _gdk_x11_display_send_xevent (display, + GDK_WINDOW_XID (context->source_window), + FALSE, 0, &xev); } } diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c index 361a4342b8..9fe8700526 100644 --- a/gdk/x11/gdkmain-x11.c +++ b/gdk/x11/gdkmain-x11.c @@ -461,27 +461,12 @@ gdk_error_trap_pop (void) return gdk_error_trap_pop_internal (TRUE); } -/** - * _gdk_send_xevent: - * @display: #GdkDisplay which @window is on - * @window: window ID to which to send the event - * @propagate: %TRUE if the event should be propagated if the target window - * doesn't handle it. - * @event_mask: event mask to match against, or 0 to send it to @window - * without regard to event masks. - * @event_send: #XEvent to send - * - * Send an event, like XSendEvent(), but trap errors and check - * the result. - * - * Return value: %TRUE if sending the event succeeded. - **/ -gint -_gdk_send_xevent (GdkDisplay *display, - Window window, - gboolean propagate, - glong event_mask, - XEvent *event_send) +gint +_gdk_x11_display_send_xevent (GdkDisplay *display, + Window window, + gboolean propagate, + glong event_mask, + XEvent *event_send) { gboolean result; @@ -489,13 +474,13 @@ _gdk_send_xevent (GdkDisplay *display, return FALSE; gdk_x11_display_error_trap_push (display); - result = XSendEvent (GDK_DISPLAY_XDISPLAY (display), window, - propagate, event_mask, event_send); + result = XSendEvent (GDK_DISPLAY_XDISPLAY (display), window, + propagate, event_mask, event_send); XSync (GDK_DISPLAY_XDISPLAY (display), False); - + if (gdk_x11_display_error_trap_pop (display)) return FALSE; - + return result; } diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h index b4dc1d1b01..859420a3f4 100644 --- a/gdk/x11/gdkprivate-x11.h +++ b/gdk/x11/gdkprivate-x11.h @@ -83,11 +83,11 @@ void _gdk_xid_table_remove (GdkDisplay *display, gpointer _gdk_xid_table_lookup (GdkDisplay *display, XID xid); -gint _gdk_send_xevent (GdkDisplay *display, - Window window, - gboolean propagate, - glong event_mask, - XEvent *event_send); +gint _gdk_x11_display_send_xevent (GdkDisplay *display, + Window window, + gboolean propagate, + glong event_mask, + XEvent *event_send); /* Routines from gdkgeometry-x11.c */ void _gdk_window_move_resize_child (GdkWindow *window, diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c index 1cc7fc5375..e703b952cb 100644 --- a/gdk/x11/gdkscreen-x11.c +++ b/gdk/x11/gdkscreen-x11.c @@ -1135,7 +1135,7 @@ gdk_event_send_client_message_to_all_recurse (GdkDisplay *display, if (send || (!found && (level == 1))) { xev->xclient.window = xid; - _gdk_send_xevent (display, xid, False, NoEventMask, xev); + _gdk_x11_display_send_xevent (display, xid, False, NoEventMask, xev); } result = send || found; diff --git a/gdk/x11/gdkselection-x11.c b/gdk/x11/gdkselection-x11.c index 49cdf3a018..e90f522b57 100644 --- a/gdk/x11/gdkselection-x11.c +++ b/gdk/x11/gdkselection-x11.c @@ -415,7 +415,7 @@ gdk_selection_send_notify_for_display (GdkDisplay *display, xevent.property = gdk_x11_atom_to_xatom_for_display (display, property); xevent.time = time; - _gdk_send_xevent (display, requestor, False, NoEventMask, (XEvent*) & xevent); + _gdk_x11_display_send_xevent (display, requestor, False, NoEventMask, (XEvent*) & xevent); } /** |