Commit fa33839d authored by Matthias Clasen's avatar Matthias Clasen

Consistently use per-display error traps in the X11 backend

parent 2d7583c0
...@@ -653,12 +653,12 @@ _gdk_x11_get_window_child_info (GdkDisplay *display, ...@@ -653,12 +653,12 @@ _gdk_x11_get_window_child_info (GdkDisplay *display,
state.children = NULL; state.children = NULL;
state.nchildren = 0; state.nchildren = 0;
gdk_error_trap_push (); gdk_x11_display_error_trap_push (display);
result = list_children_and_wm_state (dpy, window, result = list_children_and_wm_state (dpy, window,
win_has_wm_state ? wm_state_atom : None, win_has_wm_state ? wm_state_atom : None,
&has_wm_state, &has_wm_state,
&state.children, &state.nchildren); &state.children, &state.nchildren);
gdk_error_trap_pop_ignored (); gdk_x11_display_error_trap_pop_ignored (display);
if (!result) if (!result)
{ {
g_free (state.children); g_free (state.children);
......
...@@ -151,11 +151,11 @@ gdk_device_xi_constructed (GObject *object) ...@@ -151,11 +151,11 @@ gdk_device_xi_constructed (GObject *object)
device = GDK_DEVICE_XI (object); device = GDK_DEVICE_XI (object);
display = gdk_device_get_display (GDK_DEVICE (object)); display = gdk_device_get_display (GDK_DEVICE (object));
gdk_error_trap_push (); gdk_x11_display_error_trap_push (display);
device->xdevice = XOpenDevice (GDK_DISPLAY_XDISPLAY (display), device->xdevice = XOpenDevice (GDK_DISPLAY_XDISPLAY (display),
device->device_id); device->device_id);
if (gdk_error_trap_pop ()) if (gdk_x11_display_error_trap_pop (display))
g_warning ("Device %s can't be opened", g_warning ("Device %s can't be opened",
gdk_device_get_name (GDK_DEVICE (device))); gdk_device_get_name (GDK_DEVICE (device)));
......
...@@ -255,14 +255,14 @@ gdk_check_wm_desktop_changed (GdkWindow *window) ...@@ -255,14 +255,14 @@ gdk_check_wm_desktop_changed (GdkWindow *window)
gulong *desktop; gulong *desktop;
type = None; type = None;
gdk_error_trap_push (); gdk_x11_display_error_trap_push (display);
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window), GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"), gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"),
0, G_MAXLONG, False, XA_CARDINAL, &type, 0, G_MAXLONG, False, XA_CARDINAL, &type,
&format, &nitems, &format, &nitems,
&bytes_after, &data); &bytes_after, &data);
gdk_error_trap_pop_ignored (); gdk_x11_display_error_trap_pop_ignored (display);
if (type != None) if (type != None)
{ {
...@@ -298,12 +298,12 @@ gdk_check_wm_state_changed (GdkWindow *window) ...@@ -298,12 +298,12 @@ gdk_check_wm_state_changed (GdkWindow *window)
toplevel->have_fullscreen = FALSE; toplevel->have_fullscreen = FALSE;
type = None; type = None;
gdk_error_trap_push (); gdk_x11_display_error_trap_push (display);
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"), gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"),
0, G_MAXLONG, False, XA_ATOM, &type, &format, &nitems, 0, G_MAXLONG, False, XA_ATOM, &type, &format, &nitems,
&bytes_after, &data); &bytes_after, &data);
gdk_error_trap_pop_ignored (); gdk_x11_display_error_trap_pop_ignored (display);
if (type != None) if (type != None)
{ {
...@@ -709,7 +709,7 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator, ...@@ -709,7 +709,7 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
gint ty = 0; gint ty = 0;
Window child_window = 0; Window child_window = 0;
gdk_error_trap_push (); gdk_x11_display_error_trap_push (display);
if (XTranslateCoordinates (GDK_WINDOW_XDISPLAY (window), if (XTranslateCoordinates (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), GDK_WINDOW_XID (window),
screen_x11->xroot_window, screen_x11->xroot_window,
...@@ -720,7 +720,7 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator, ...@@ -720,7 +720,7 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
event->configure.x = tx; event->configure.x = tx;
event->configure.y = ty; event->configure.y = ty;
} }
gdk_error_trap_pop_ignored (); gdk_x11_display_error_trap_pop_ignored (display);
} }
else else
{ {
...@@ -1346,11 +1346,11 @@ _gdk_x11_display_open (const gchar *display_name) ...@@ -1346,11 +1346,11 @@ _gdk_x11_display_open (const gchar *display_name)
int rootx, rooty, winx, winy; int rootx, rooty, winx, winy;
unsigned int xmask; unsigned int xmask;
gdk_error_trap_push (); gdk_x11_display_error_trap_push (display);
XQueryPointer (display_x11->xdisplay, XQueryPointer (display_x11->xdisplay,
GDK_SCREEN_X11 (display_x11->default_screen)->xroot_window, GDK_SCREEN_X11 (display_x11->default_screen)->xroot_window,
&root, &child, &rootx, &rooty, &winx, &winy, &xmask); &root, &child, &rootx, &rooty, &winx, &winy, &xmask);
if (G_UNLIKELY (gdk_error_trap_pop () == BadWindow)) if (G_UNLIKELY (gdk_x11_display_error_trap_pop (display) == BadWindow))
{ {
g_warning ("Connection to display %s appears to be untrusted. Pointer and keyboard grabs and inter-client communication may not work as expected.", gdk_display_get_name (display)); g_warning ("Connection to display %s appears to be untrusted. Pointer and keyboard grabs and inter-client communication may not work as expected.", gdk_display_get_name (display));
display_x11->trusted_client = FALSE; display_x11->trusted_client = FALSE;
...@@ -2144,14 +2144,14 @@ gdk_x11_display_store_clipboard (GdkDisplay *display, ...@@ -2144,14 +2144,14 @@ gdk_x11_display_store_clipboard (GdkDisplay *display,
clipboard_manager = gdk_x11_get_xatom_by_name_for_display (display, "CLIPBOARD_MANAGER"); clipboard_manager = gdk_x11_get_xatom_by_name_for_display (display, "CLIPBOARD_MANAGER");
save_targets = gdk_x11_get_xatom_by_name_for_display (display, "SAVE_TARGETS"); save_targets = gdk_x11_get_xatom_by_name_for_display (display, "SAVE_TARGETS");
gdk_error_trap_push (); gdk_x11_display_error_trap_push (display);
if (XGetSelectionOwner (display_x11->xdisplay, clipboard_manager) != None) if (XGetSelectionOwner (display_x11->xdisplay, clipboard_manager) != None)
{ {
Atom property_name = None; Atom property_name = None;
Atom *xatoms; Atom *xatoms;
int i; int i;
if (n_targets > 0) if (n_targets > 0)
{ {
property_name = gdk_x11_atom_to_xatom_for_display (display, _gdk_selection_property); property_name = gdk_x11_atom_to_xatom_for_display (display, _gdk_selection_property);
...@@ -2166,13 +2166,13 @@ gdk_x11_display_store_clipboard (GdkDisplay *display, ...@@ -2166,13 +2166,13 @@ gdk_x11_display_store_clipboard (GdkDisplay *display,
g_free (xatoms); g_free (xatoms);
} }
XConvertSelection (display_x11->xdisplay, XConvertSelection (display_x11->xdisplay,
clipboard_manager, save_targets, property_name, clipboard_manager, save_targets, property_name,
GDK_WINDOW_XID (clipboard_window), time_); GDK_WINDOW_XID (clipboard_window), time_);
} }
gdk_error_trap_pop_ignored (); gdk_x11_display_error_trap_pop_ignored (display);
} }
......
...@@ -567,6 +567,7 @@ static void ...@@ -567,6 +567,7 @@ static void
gdk_window_cache_destroy (GdkWindowCache *cache) gdk_window_cache_destroy (GdkWindowCache *cache)
{ {
GdkWindow *root_window = gdk_screen_get_root_window (cache->screen); GdkWindow *root_window = gdk_screen_get_root_window (cache->screen);
GdkDisplay *display;
XSelectInput (GDK_WINDOW_XDISPLAY (root_window), XSelectInput (GDK_WINDOW_XDISPLAY (root_window),
GDK_WINDOW_XID (root_window), GDK_WINDOW_XID (root_window),
...@@ -574,12 +575,11 @@ gdk_window_cache_destroy (GdkWindowCache *cache) ...@@ -574,12 +575,11 @@ gdk_window_cache_destroy (GdkWindowCache *cache)
gdk_window_remove_filter (root_window, gdk_window_cache_filter, cache); gdk_window_remove_filter (root_window, gdk_window_cache_filter, cache);
gdk_window_remove_filter (NULL, gdk_window_cache_shape_filter, cache); gdk_window_remove_filter (NULL, gdk_window_cache_shape_filter, cache);
gdk_error_trap_push (); display = gdk_screen_get_display (cache->screen);
g_list_foreach (cache->children, (GFunc)free_cache_child,
gdk_screen_get_display (cache->screen));
gdk_error_trap_pop_ignored (); gdk_x11_display_error_trap_push (display);
g_list_foreach (cache->children, (GFunc)free_cache_child, display);
gdk_x11_display_error_trap_pop_ignored (display);
g_list_free (cache->children); g_list_free (cache->children);
g_hash_table_destroy (cache->child_hash); g_hash_table_destroy (cache->child_hash);
...@@ -682,7 +682,7 @@ get_client_window_at_coords_recurse (GdkDisplay *display, ...@@ -682,7 +682,7 @@ get_client_window_at_coords_recurse (GdkDisplay *display,
return None; return None;
} }
static Window static Window
get_client_window_at_coords (GdkWindowCache *cache, get_client_window_at_coords (GdkWindowCache *cache,
Window ignore, Window ignore,
gint x_root, gint x_root,
...@@ -690,9 +690,12 @@ get_client_window_at_coords (GdkWindowCache *cache, ...@@ -690,9 +690,12 @@ get_client_window_at_coords (GdkWindowCache *cache,
{ {
GList *tmp_list; GList *tmp_list;
Window retval = None; Window retval = None;
GdkDisplay *display;
display = gdk_screen_get_display (cache->screen);
gdk_x11_display_error_trap_push (display);
gdk_error_trap_push ();
tmp_list = cache->children; tmp_list = cache->children;
while (tmp_list && !retval) while (tmp_list && !retval)
...@@ -704,8 +707,6 @@ get_client_window_at_coords (GdkWindowCache *cache, ...@@ -704,8 +707,6 @@ get_client_window_at_coords (GdkWindowCache *cache,
if ((x_root >= child->x) && (x_root < child->x + child->width) && if ((x_root >= child->x) && (x_root < child->x + child->width) &&
(y_root >= child->y) && (y_root < child->y + child->height)) (y_root >= child->y) && (y_root < child->y + child->height))
{ {
GdkDisplay *display = gdk_screen_get_display (cache->screen);
if (!is_pointer_within_shape (display, child, if (!is_pointer_within_shape (display, child,
x_root - child->x, x_root - child->x,
y_root - child->y)) y_root - child->y))
...@@ -725,7 +726,7 @@ get_client_window_at_coords (GdkWindowCache *cache, ...@@ -725,7 +726,7 @@ get_client_window_at_coords (GdkWindowCache *cache,
tmp_list = tmp_list->next; tmp_list = tmp_list->next;
} }
gdk_error_trap_pop_ignored (); gdk_x11_display_error_trap_pop_ignored (display);
if (retval) if (retval)
return retval; return retval;
...@@ -1028,36 +1029,38 @@ motif_read_target_table (GdkDisplay *display) ...@@ -1028,36 +1029,38 @@ motif_read_target_table (GdkDisplay *display)
guchar *p; guchar *p;
gboolean success = FALSE; gboolean success = FALSE;
gdk_error_trap_push (); gdk_x11_display_error_trap_push (display);
XGetWindowProperty (display_x11->xdisplay, XGetWindowProperty (display_x11->xdisplay,
display_x11->motif_drag_window, display_x11->motif_drag_window,
motif_drag_targets_atom, motif_drag_targets_atom,
0, (sizeof(MotifTargetTableHeader)+3)/4, FALSE, 0, (sizeof(MotifTargetTableHeader)+3)/4, FALSE,
motif_drag_targets_atom, motif_drag_targets_atom,
&type, &format, &nitems, &bytes_after, &type, &format, &nitems, &bytes_after,
&data); &data);
if (gdk_error_trap_pop () || (format != 8) || (nitems < sizeof (MotifTargetTableHeader))) if (gdk_x11_display_error_trap_pop (display) ||
goto error; (format != 8) || (nitems < sizeof (MotifTargetTableHeader)))
goto error;
header = (MotifTargetTableHeader *)data; header = (MotifTargetTableHeader *)data;
header->n_lists = card16_to_host (header->n_lists, header->byte_order); header->n_lists = card16_to_host (header->n_lists, header->byte_order);
header->total_size = card32_to_host (header->total_size, header->byte_order); header->total_size = card32_to_host (header->total_size, header->byte_order);
gdk_error_trap_push (); gdk_x11_display_error_trap_push (display);
XGetWindowProperty (display_x11->xdisplay, XGetWindowProperty (display_x11->xdisplay,
display_x11->motif_drag_window, display_x11->motif_drag_window,
motif_drag_targets_atom, motif_drag_targets_atom,
(sizeof(MotifTargetTableHeader)+3)/4, (sizeof(MotifTargetTableHeader)+3)/4,
(header->total_size + 3)/4 - (sizeof(MotifTargetTableHeader) + 3)/4, (header->total_size + 3)/4 - (sizeof(MotifTargetTableHeader) + 3)/4,
FALSE, FALSE,
motif_drag_targets_atom, &type, &format, &nitems, motif_drag_targets_atom, &type, &format, &nitems,
&bytes_after, &target_bytes); &bytes_after, &target_bytes);
if (gdk_error_trap_pop () || (format != 8) || (bytes_after != 0) || if (gdk_x11_display_error_trap_pop (display) ||
(nitems != header->total_size - sizeof(MotifTargetTableHeader))) (format != 8) || (bytes_after != 0) ||
goto error; (nitems != header->total_size - sizeof(MotifTargetTableHeader)))
goto error;
display_x11->motif_n_target_lists = header->n_lists; display_x11->motif_n_target_lists = header->n_lists;
display_x11->motif_target_lists = g_new0 (GList *, display_x11->motif_n_target_lists); display_x11->motif_target_lists = g_new0 (GList *, display_x11->motif_n_target_lists);
...@@ -1067,7 +1070,7 @@ motif_read_target_table (GdkDisplay *display) ...@@ -1067,7 +1070,7 @@ motif_read_target_table (GdkDisplay *display)
{ {
gint n_targets; gint n_targets;
guint32 *targets; guint32 *targets;
if (p + sizeof(guint16) - target_bytes > nitems) if (p + sizeof(guint16) - target_bytes > nitems)
goto error; goto error;
...@@ -1384,14 +1387,14 @@ motif_check_dest (GdkDisplay *display, ...@@ -1384,14 +1387,14 @@ motif_check_dest (GdkDisplay *display,
unsigned long nitems, after; unsigned long nitems, after;
Atom motif_drag_receiver_info_atom = gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_RECEIVER_INFO"); Atom motif_drag_receiver_info_atom = gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_RECEIVER_INFO");
gdk_error_trap_push (); gdk_x11_display_error_trap_push (display);
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), win, XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), win,
motif_drag_receiver_info_atom, motif_drag_receiver_info_atom,
0, (sizeof(*info)+3)/4, False, AnyPropertyType, 0, (sizeof(*info)+3)/4, False, AnyPropertyType,
&type, &format, &nitems, &after, &type, &format, &nitems, &after,
&data); &data);
if (gdk_error_trap_pop() == 0) if (gdk_x11_display_error_trap_pop (display) == 0)
{ {
if (type != None) if (type != None)
{ {
...@@ -1583,17 +1586,19 @@ motif_read_initiator_info (GdkDisplay *display, ...@@ -1583,17 +1586,19 @@ motif_read_initiator_info (GdkDisplay *display,
gulong bytes_after; gulong bytes_after;
guchar *data; guchar *data;
MotifDragInitiatorInfo *initiator_info; MotifDragInitiatorInfo *initiator_info;
GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display); GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
gdk_error_trap_push (); gdk_x11_display_error_trap_push (display);
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), source_window, atom, XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), source_window, atom,
0, sizeof(*initiator_info), FALSE, 0, sizeof(*initiator_info), FALSE,
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"),
&type, &format, &nitems, &bytes_after, &type, &format, &nitems, &bytes_after,
&data); &data);
if (gdk_error_trap_pop () || (format != 8) || (nitems != sizeof (MotifDragInitiatorInfo)) || (bytes_after != 0)) if (gdk_x11_display_error_trap_pop (display) ||
(format != 8) || (nitems != sizeof (MotifDragInitiatorInfo)) ||
(bytes_after != 0))
{ {
g_warning ("Error reading initiator info\n"); g_warning ("Error reading initiator info\n");
return FALSE; return FALSE;
...@@ -2533,13 +2538,12 @@ xdnd_check_dest (GdkDisplay *display, ...@@ -2533,13 +2538,12 @@ xdnd_check_dest (GdkDisplay *display,
proxy = None; proxy = None;
gdk_error_trap_push (); gdk_x11_display_error_trap_push (display);
if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), win, if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), win,
xdnd_proxy_atom, 0, xdnd_proxy_atom, 0,
1, False, AnyPropertyType, 1, False, AnyPropertyType,
&type, &format, &nitems, &after, &type, &format, &nitems, &after,
&data) == Success) &data) == Success)
{ {
if (type != None) if (type != None)
{ {
...@@ -2582,7 +2586,7 @@ xdnd_check_dest (GdkDisplay *display, ...@@ -2582,7 +2586,7 @@ xdnd_check_dest (GdkDisplay *display,
} }
} }
gdk_error_trap_pop_ignored (); gdk_x11_display_error_trap_pop_ignored (display);
return retval ? (proxy ? proxy : win) : None; return retval ? (proxy ? proxy : win) : None;
} }
...@@ -2607,20 +2611,19 @@ xdnd_read_actions (GdkDragContextX11 *context_x11) ...@@ -2607,20 +2611,19 @@ xdnd_read_actions (GdkDragContextX11 *context_x11)
{ {
/* Get the XdndActionList, if set */ /* Get the XdndActionList, if set */
gdk_error_trap_push (); gdk_x11_display_error_trap_push (display);
if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_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,
&after, &data) == Success && &after, &data) == Success &&
type == XA_ATOM) type == XA_ATOM)
{ {
atoms = (Atom *)data; atoms = (Atom *)data;
context->actions = 0; context->actions = 0;
for (i = 0; i < nitems; i++) for (i = 0; i < nitems; i++)
context->actions |= xdnd_action_from_atom (display, atoms[i]); context->actions |= xdnd_action_from_atom (display, atoms[i]);
...@@ -2647,9 +2650,9 @@ xdnd_read_actions (GdkDragContextX11 *context_x11) ...@@ -2647,9 +2650,9 @@ xdnd_read_actions (GdkDragContextX11 *context_x11)
} }
if (data) if (data)
XFree (data); XFree (data);
gdk_error_trap_pop_ignored (); gdk_x11_display_error_trap_pop_ignored (display);
} }
else else
{ {
...@@ -2703,7 +2706,7 @@ xdnd_manage_source_filter (GdkDragContext *context, ...@@ -2703,7 +2706,7 @@ xdnd_manage_source_filter (GdkDragContext *context,
if (!GDK_WINDOW_DESTROYED (window) && if (!GDK_WINDOW_DESTROYED (window) &&
gdk_window_get_window_type (window) == GDK_WINDOW_FOREIGN) gdk_window_get_window_type (window) == GDK_WINDOW_FOREIGN)
{ {
gdk_error_trap_push (); gdk_x11_display_error_trap_push (GDK_WINDOW_DISPLAY (window));
if (add_filter) if (add_filter)
{ {
...@@ -2723,7 +2726,7 @@ xdnd_manage_source_filter (GdkDragContext *context, ...@@ -2723,7 +2726,7 @@ xdnd_manage_source_filter (GdkDragContext *context,
*/ */
} }
gdk_error_trap_pop_ignored (); gdk_x11_display_error_trap_pop_ignored (GDK_WINDOW_DISPLAY (window));
} }
} }
...@@ -2861,7 +2864,7 @@ xdnd_enter_filter (GdkXEvent *xev, ...@@ -2861,7 +2864,7 @@ xdnd_enter_filter (GdkXEvent *xev,
context->targets = NULL; context->targets = NULL;
if (get_types) if (get_types)
{ {
gdk_error_trap_push (); gdk_x11_display_error_trap_push (display);
XGetWindowProperty (GDK_WINDOW_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"),
...@@ -2869,7 +2872,7 @@ xdnd_enter_filter (GdkXEvent *xev, ...@@ -2869,7 +2872,7 @@ xdnd_enter_filter (GdkXEvent *xev,
False, XA_ATOM, &type, &format, &nitems, False, XA_ATOM, &type, &format, &nitems,
&after, &data); &after, &data);
if (gdk_error_trap_pop () || (format != 32) || (type != XA_ATOM)) if (gdk_x11_display_error_trap_pop (display) || (format != 32) || (type != XA_ATOM))
{ {
g_object_unref (context); g_object_unref (context);
......
...@@ -488,12 +488,12 @@ _gdk_send_xevent (GdkDisplay *display, ...@@ -488,12 +488,12 @@ _gdk_send_xevent (GdkDisplay *display,
if (gdk_display_is_closed (display)) if (gdk_display_is_closed (display))
return FALSE; return FALSE;
gdk_error_trap_push (); gdk_x11_display_error_trap_push (display);
result = XSendEvent (GDK_DISPLAY_XDISPLAY (display), window, result = XSendEvent (GDK_DISPLAY_XDISPLAY (display), window,
propagate, event_mask, event_send); propagate, event_mask, event_send);
XSync (GDK_DISPLAY_XDISPLAY (display), False); XSync (GDK_DISPLAY_XDISPLAY (display), False);
if (gdk_error_trap_pop ()) if (gdk_x11_display_error_trap_pop (display))
return FALSE; return FALSE;
return result; return result;
......
...@@ -355,9 +355,9 @@ gdk_x11_xatom_to_atom_for_display (GdkDisplay *display, ...@@ -355,9 +355,9 @@ gdk_x11_xatom_to_atom_for_display (GdkDisplay *display,
* we take precautions * we take precautions
*/ */
char *name; char *name;
gdk_error_trap_push (); gdk_x11_display_error_trap_push (display);
name = XGetAtomName (GDK_DISPLAY_XDISPLAY (display), xatom); name = XGetAtomName (GDK_DISPLAY_XDISPLAY (display), xatom);
if (gdk_error_trap_pop ()) if (gdk_x11_display_error_trap_pop (display))
{ {
g_warning (G_STRLOC " invalid X atom: %ld", xatom); g_warning (G_STRLOC " invalid X atom: %ld", xatom);
} }
......
...@@ -1104,7 +1104,7 @@ gdk_event_send_client_message_to_all_recurse (GdkDisplay *display, ...@@ -1104,7 +1104,7 @@ gdk_event_send_client_message_to_all_recurse (GdkDisplay *display,
gboolean result = FALSE; gboolean result = FALSE;
int i;