Do not use deprecated error trap API
Use the X11-specific API instead.
This commit is contained in:
parent
4e5ef1a377
commit
c03ce68c38
@ -418,7 +418,7 @@ gtk_tray_icon_get_orientation_property (GtkTrayIcon *icon)
|
||||
|
||||
g_assert (icon->priv->manager_window != None);
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
type = None;
|
||||
result = XGetWindowProperty (xdisplay,
|
||||
icon->priv->manager_window,
|
||||
@ -427,7 +427,7 @@ gtk_tray_icon_get_orientation_property (GtkTrayIcon *icon)
|
||||
XA_CARDINAL,
|
||||
&type, &format, &nitems,
|
||||
&bytes_after, &(prop.prop_ch));
|
||||
error = gdk_error_trap_pop ();
|
||||
error = gdk_x11_display_error_trap_pop (display);
|
||||
|
||||
if (error || result != Success)
|
||||
return;
|
||||
@ -471,7 +471,7 @@ gtk_tray_icon_get_visual_property (GtkTrayIcon *icon)
|
||||
|
||||
g_assert (icon->priv->manager_window != None);
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
type = None;
|
||||
result = XGetWindowProperty (xdisplay,
|
||||
icon->priv->manager_window,
|
||||
@ -480,7 +480,7 @@ gtk_tray_icon_get_visual_property (GtkTrayIcon *icon)
|
||||
XA_VISUALID,
|
||||
&type, &format, &nitems,
|
||||
&bytes_after, &(prop.prop_ch));
|
||||
error = gdk_error_trap_pop ();
|
||||
error = gdk_x11_display_error_trap_pop (display);
|
||||
|
||||
if (!error && result == Success &&
|
||||
type == XA_VISUALID && nitems == 1 && format == 32)
|
||||
@ -535,7 +535,7 @@ gtk_tray_icon_get_colors_property (GtkTrayIcon *icon)
|
||||
|
||||
g_assert (icon->priv->manager_window != None);
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
type = None;
|
||||
result = XGetWindowProperty (xdisplay,
|
||||
icon->priv->manager_window,
|
||||
@ -544,7 +544,7 @@ gtk_tray_icon_get_colors_property (GtkTrayIcon *icon)
|
||||
XA_CARDINAL,
|
||||
&type, &format, &nitems,
|
||||
&bytes_after, &(prop.prop_ch));
|
||||
error = gdk_error_trap_pop ();
|
||||
error = gdk_x11_display_error_trap_pop (display);
|
||||
|
||||
if (error || result != Success)
|
||||
return;
|
||||
@ -626,7 +626,7 @@ gtk_tray_icon_get_padding_property (GtkTrayIcon *icon)
|
||||
|
||||
g_assert (icon->priv->manager_window != None);
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
type = None;
|
||||
result = XGetWindowProperty (xdisplay,
|
||||
icon->priv->manager_window,
|
||||
@ -635,7 +635,7 @@ gtk_tray_icon_get_padding_property (GtkTrayIcon *icon)
|
||||
XA_CARDINAL,
|
||||
&type, &format, &nitems,
|
||||
&bytes_after, &(prop.prop_ch));
|
||||
error = gdk_error_trap_pop ();
|
||||
error = gdk_x11_display_error_trap_pop (display);
|
||||
|
||||
if (!error && result == Success &&
|
||||
type == XA_CARDINAL && nitems == 1 && format == 32)
|
||||
@ -675,7 +675,7 @@ gtk_tray_icon_get_icon_size_property (GtkTrayIcon *icon)
|
||||
|
||||
g_assert (icon->priv->manager_window != None);
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
type = None;
|
||||
result = XGetWindowProperty (xdisplay,
|
||||
icon->priv->manager_window,
|
||||
@ -684,7 +684,7 @@ gtk_tray_icon_get_icon_size_property (GtkTrayIcon *icon)
|
||||
XA_CARDINAL,
|
||||
&type, &format, &nitems,
|
||||
&bytes_after, &(prop.prop_ch));
|
||||
error = gdk_error_trap_pop ();
|
||||
error = gdk_x11_display_error_trap_pop (display);
|
||||
|
||||
if (!error && result == Success &&
|
||||
type == XA_CARDINAL && nitems == 1 && format == 32)
|
||||
@ -777,7 +777,8 @@ gtk_tray_icon_send_manager_message (GtkTrayIcon *icon,
|
||||
{
|
||||
GtkWidget *widget;
|
||||
XClientMessageEvent ev;
|
||||
Display *display;
|
||||
GdkDisplay *display;
|
||||
Display *xdisplay;
|
||||
|
||||
widget = GTK_WIDGET (icon);
|
||||
|
||||
@ -792,12 +793,15 @@ gtk_tray_icon_send_manager_message (GtkTrayIcon *icon,
|
||||
ev.data.l[3] = data2;
|
||||
ev.data.l[4] = data3;
|
||||
|
||||
display = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (widget));
|
||||
display = gtk_widget_get_display (widget);
|
||||
xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
||||
|
||||
gdk_error_trap_push ();
|
||||
XSendEvent (display,
|
||||
icon->priv->manager_window, False, NoEventMask, (XEvent *)&ev);
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
XSendEvent (xdisplay,
|
||||
icon->priv->manager_window,
|
||||
False, NoEventMask,
|
||||
(XEvent *)&ev);
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -994,6 +998,7 @@ _gtk_tray_icon_send_message (GtkTrayIcon *icon,
|
||||
gint len)
|
||||
{
|
||||
guint stamp;
|
||||
GdkDisplay *display;
|
||||
Display *xdisplay;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_TRAY_ICON (icon), 0);
|
||||
@ -1014,8 +1019,9 @@ _gtk_tray_icon_send_message (GtkTrayIcon *icon,
|
||||
timeout, len, stamp);
|
||||
|
||||
/* Now to send the actual message */
|
||||
xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
|
||||
gdk_error_trap_push ();
|
||||
display = gtk_widget_get_display (GTK_WIDGET (icon));
|
||||
xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
while (len > 0)
|
||||
{
|
||||
XClientMessageEvent ev;
|
||||
@ -1042,7 +1048,7 @@ _gtk_tray_icon_send_message (GtkTrayIcon *icon,
|
||||
icon->priv->manager_window, False,
|
||||
StructureNotifyMask, (XEvent *)&ev);
|
||||
}
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
|
||||
return stamp;
|
||||
}
|
||||
|
16
gtk/gtkdnd.c
16
gtk/gtkdnd.c
@ -414,6 +414,7 @@ grab_dnd_keys (GtkWidget *widget,
|
||||
guint32 time)
|
||||
{
|
||||
guint i;
|
||||
GdkDisplay *display;
|
||||
GdkWindow *window, *root;
|
||||
gint keycode;
|
||||
#ifdef XINPUT_2
|
||||
@ -445,9 +446,10 @@ grab_dnd_keys (GtkWidget *widget,
|
||||
using_xi2 = FALSE;
|
||||
#endif
|
||||
|
||||
display = gtk_widget_get_display (widget);
|
||||
root = gdk_screen_get_root_window (gtk_widget_get_screen (widget));
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (grab_keys); ++i)
|
||||
{
|
||||
@ -490,8 +492,8 @@ grab_dnd_keys (GtkWidget *widget,
|
||||
GrabModeAsync);
|
||||
}
|
||||
|
||||
gdk_flush ();
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_display_flush (display);
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
|
||||
gdk_window_add_filter (NULL, root_key_filter, (gpointer) GDK_WINDOW_XID (window));
|
||||
}
|
||||
@ -503,6 +505,7 @@ ungrab_dnd_keys (GtkWidget *widget,
|
||||
{
|
||||
guint i;
|
||||
GdkWindow *window, *root;
|
||||
GdkDisplay *display;
|
||||
gint keycode;
|
||||
#ifdef XINPUT_2
|
||||
XIGrabModifiers mods;
|
||||
@ -527,11 +530,12 @@ ungrab_dnd_keys (GtkWidget *widget,
|
||||
using_xi2 = FALSE;
|
||||
#endif
|
||||
|
||||
display = gtk_widget_get_display (widget);
|
||||
root = gdk_screen_get_root_window (gtk_widget_get_screen (widget));
|
||||
|
||||
gdk_window_remove_filter (NULL, root_key_filter, (gpointer) GDK_WINDOW_XID (window));
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (grab_keys); ++i)
|
||||
{
|
||||
@ -559,8 +563,8 @@ ungrab_dnd_keys (GtkWidget *widget,
|
||||
GDK_WINDOW_XID (root));
|
||||
}
|
||||
|
||||
gdk_flush ();
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_display_flush (display);
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
}
|
||||
|
||||
#else /* !GDK_WINDOWING_X11 */
|
||||
|
@ -49,35 +49,35 @@
|
||||
/* ---------------------------------------------------------------------------------------------------- */
|
||||
/* these functions are based on code from libwnck (LGPLv2) */
|
||||
|
||||
static gboolean get_window_list (Display *xdisplay,
|
||||
Window xwindow,
|
||||
Atom atom,
|
||||
Window **windows,
|
||||
int *len);
|
||||
static gboolean get_window_list (GdkDisplay *display,
|
||||
Window xwindow,
|
||||
Atom atom,
|
||||
Window **windows,
|
||||
int *len);
|
||||
|
||||
static char* get_utf8_property (Display *xdisplay,
|
||||
Window xwindow,
|
||||
Atom atom);
|
||||
static char* get_utf8_property (GdkDisplay *display,
|
||||
Window xwindow,
|
||||
Atom atom);
|
||||
|
||||
static gboolean get_cardinal (Display *xdisplay,
|
||||
Window xwindow,
|
||||
Atom atom,
|
||||
int *val);
|
||||
static gboolean get_cardinal (GdkDisplay *display,
|
||||
Window xwindow,
|
||||
Atom atom,
|
||||
int *val);
|
||||
|
||||
static gboolean read_rgb_icon (Display *xdisplay,
|
||||
Window xwindow,
|
||||
int ideal_width,
|
||||
int ideal_height,
|
||||
int *width,
|
||||
int *height,
|
||||
guchar **pixdata);
|
||||
static gboolean read_rgb_icon (GdkDisplay *display,
|
||||
Window xwindow,
|
||||
int ideal_width,
|
||||
int ideal_height,
|
||||
int *width,
|
||||
int *height,
|
||||
guchar **pixdata);
|
||||
|
||||
|
||||
static gboolean
|
||||
get_cardinal (Display *xdisplay,
|
||||
Window xwindow,
|
||||
Atom atom,
|
||||
int *val)
|
||||
get_cardinal (GdkDisplay *display,
|
||||
Window xwindow,
|
||||
Atom atom,
|
||||
int *val)
|
||||
{
|
||||
Atom type;
|
||||
int format;
|
||||
@ -88,16 +88,16 @@ get_cardinal (Display *xdisplay,
|
||||
|
||||
*val = 0;
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
type = None;
|
||||
result = XGetWindowProperty (xdisplay,
|
||||
result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
|
||||
xwindow,
|
||||
atom,
|
||||
0, G_MAXLONG,
|
||||
False, XA_CARDINAL, &type, &format, &nitems,
|
||||
&bytes_after, (void*)&num);
|
||||
XSync (xdisplay, False);
|
||||
err = gdk_error_trap_pop ();
|
||||
XSync (GDK_DISPLAY_XDISPLAY (display), False);
|
||||
err = gdk_x11_display_error_trap_pop (display);
|
||||
|
||||
if (err != Success ||
|
||||
result != Success)
|
||||
@ -117,9 +117,9 @@ get_cardinal (Display *xdisplay,
|
||||
}
|
||||
|
||||
static char*
|
||||
get_utf8_property (Display *xdisplay,
|
||||
Window xwindow,
|
||||
Atom atom)
|
||||
get_utf8_property (GdkDisplay *display,
|
||||
Window xwindow,
|
||||
Atom atom)
|
||||
{
|
||||
Atom type;
|
||||
int format;
|
||||
@ -132,18 +132,18 @@ get_utf8_property (Display *xdisplay,
|
||||
|
||||
utf8_string = gdk_x11_get_xatom_by_name ("UTF8_STRING");
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
type = None;
|
||||
val = NULL;
|
||||
result = XGetWindowProperty (xdisplay,
|
||||
result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
|
||||
xwindow,
|
||||
atom,
|
||||
0, G_MAXLONG,
|
||||
False, utf8_string,
|
||||
&type, &format, &nitems,
|
||||
&bytes_after, (guchar **)&val);
|
||||
XSync (xdisplay, False);
|
||||
err = gdk_error_trap_pop ();
|
||||
XSync (GDK_DISPLAY_XDISPLAY (display), False);
|
||||
err = gdk_x11_display_error_trap_pop (display);
|
||||
|
||||
if (err != Success ||
|
||||
result != Success)
|
||||
@ -336,13 +336,13 @@ argbdata_to_pixdata (gulong *argb_data,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
read_rgb_icon (Display *xdisplay,
|
||||
Window xwindow,
|
||||
int ideal_width,
|
||||
int ideal_height,
|
||||
int *width,
|
||||
int *height,
|
||||
guchar **pixdata)
|
||||
read_rgb_icon (GdkDisplay *display,
|
||||
Window xwindow,
|
||||
int ideal_width,
|
||||
int ideal_height,
|
||||
int *width,
|
||||
int *height,
|
||||
guchar **pixdata)
|
||||
{
|
||||
Atom type;
|
||||
int format;
|
||||
@ -353,18 +353,17 @@ read_rgb_icon (Display *xdisplay,
|
||||
gulong *best;
|
||||
int w, h;
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
type = None;
|
||||
data = NULL;
|
||||
result = XGetWindowProperty (xdisplay,
|
||||
result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
|
||||
xwindow,
|
||||
gdk_x11_get_xatom_by_name ("_NET_WM_ICON"),
|
||||
0, G_MAXLONG,
|
||||
False, XA_CARDINAL, &type, &format, &nitems,
|
||||
&bytes_after, (void*)&data);
|
||||
|
||||
XSync (xdisplay, False);
|
||||
err = gdk_error_trap_pop ();
|
||||
XSync (GDK_DISPLAY_XDISPLAY (display), False);
|
||||
err = gdk_x11_display_error_trap_pop (display);
|
||||
|
||||
if (err != Success ||
|
||||
result != Success)
|
||||
@ -457,11 +456,11 @@ scaled_from_pixdata (guchar *pixdata,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
get_window_list (Display *xdisplay,
|
||||
Window xwindow,
|
||||
Atom atom,
|
||||
Window **windows,
|
||||
int *len)
|
||||
get_window_list (GdkDisplay *display,
|
||||
Window xwindow,
|
||||
Atom atom,
|
||||
Window **windows,
|
||||
int *len)
|
||||
{
|
||||
Atom type;
|
||||
int format;
|
||||
@ -473,16 +472,16 @@ get_window_list (Display *xdisplay,
|
||||
*windows = NULL;
|
||||
*len = 0;
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
type = None;
|
||||
result = XGetWindowProperty (xdisplay,
|
||||
result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
|
||||
xwindow,
|
||||
atom,
|
||||
0, G_MAXLONG,
|
||||
False, XA_WINDOW, &type, &format, &nitems,
|
||||
&bytes_after, (void*)&data);
|
||||
XSync (xdisplay, False);
|
||||
err = gdk_error_trap_pop ();
|
||||
XSync (GDK_DISPLAY_XDISPLAY (display), False);
|
||||
err = gdk_x11_display_error_trap_pop (display);
|
||||
|
||||
if (err != Success ||
|
||||
result != Success)
|
||||
@ -532,7 +531,7 @@ _gtk_mount_operation_lookup_context_get (GdkDisplay *display)
|
||||
|
||||
mapping = NULL;
|
||||
mapping_length = 0;
|
||||
get_window_list (GDK_DISPLAY_XDISPLAY (context->display),
|
||||
get_window_list (context->display,
|
||||
GDK_ROOT_WINDOW(),
|
||||
gdk_x11_get_xatom_by_name_for_display (context->display,
|
||||
"_NET_CLIENT_LIST"),
|
||||
@ -542,7 +541,7 @@ _gtk_mount_operation_lookup_context_get (GdkDisplay *display)
|
||||
{
|
||||
gint pid;
|
||||
|
||||
if (!get_cardinal (GDK_DISPLAY_XDISPLAY (context->display),
|
||||
if (!get_cardinal (context->display,
|
||||
mapping[n],
|
||||
gdk_x11_get_xatom_by_name_for_display (context->display,
|
||||
"_NET_WM_PID"),
|
||||
@ -883,12 +882,12 @@ get_name_for_window_with_pid (GtkMountOperationLookupContext *context,
|
||||
|
||||
if (window != None)
|
||||
{
|
||||
ret = get_utf8_property (GDK_DISPLAY_XDISPLAY (context->display),
|
||||
ret = get_utf8_property (context->display,
|
||||
window,
|
||||
gdk_x11_get_xatom_by_name_for_display (context->display,
|
||||
"_NET_WM_NAME"));
|
||||
if (ret == NULL)
|
||||
ret = get_utf8_property (GDK_DISPLAY_XDISPLAY (context->display),
|
||||
ret = get_utf8_property (context->display,
|
||||
window, gdk_x11_get_xatom_by_name_for_display (context->display,
|
||||
"_NET_WM_ICON_NAME"));
|
||||
}
|
||||
@ -931,7 +930,7 @@ get_pixbuf_for_window_with_pid (GtkMountOperationLookupContext *context,
|
||||
gint height;
|
||||
guchar *pixdata;
|
||||
|
||||
if (read_rgb_icon (GDK_DISPLAY_XDISPLAY (context->display),
|
||||
if (read_rgb_icon (context->display,
|
||||
window,
|
||||
size_pixels, size_pixels,
|
||||
&width, &height,
|
||||
|
@ -1048,12 +1048,13 @@ gtk_plug_realize (GtkWidget *widget)
|
||||
|
||||
if (gtk_widget_is_toplevel (widget))
|
||||
{
|
||||
GdkDisplay *display = gtk_widget_get_display (widget);
|
||||
GdkWindow *root_window;
|
||||
attributes.window_type = GDK_WINDOW_TOPLEVEL;
|
||||
|
||||
root_window = gdk_screen_get_root_window (screen);
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
if (priv->socket_window)
|
||||
gdk_window = gdk_window_new (priv->socket_window,
|
||||
&attributes, attributes_mask);
|
||||
@ -1070,11 +1071,11 @@ gtk_plug_realize (GtkWidget *widget)
|
||||
gtk_widget_set_window (widget, gdk_window);
|
||||
|
||||
gdk_display_sync (gtk_widget_get_display (widget));
|
||||
if (gdk_error_trap_pop ()) /* Uh-oh */
|
||||
if (gdk_x11_display_error_trap_pop (display)) /* Uh-oh */
|
||||
{
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
gdk_window_destroy (gdk_window);
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
gdk_window = gdk_window_new (root_window,
|
||||
&attributes, attributes_mask);
|
||||
gtk_widget_set_window (widget, gdk_window);
|
||||
|
@ -489,10 +489,12 @@ static void
|
||||
gtk_socket_size_request (GtkSocket *socket)
|
||||
{
|
||||
GtkSocketPrivate *private = socket->priv;
|
||||
GdkDisplay *display;
|
||||
XSizeHints hints;
|
||||
long supplied;
|
||||
|
||||
gdk_error_trap_push ();
|
||||
|
||||
display = gtk_widget_get_display (GTK_WIDGET (socket));
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
|
||||
private->request_width = 1;
|
||||
private->request_height = 1;
|
||||
@ -514,7 +516,7 @@ gtk_socket_size_request (GtkSocket *socket)
|
||||
}
|
||||
private->have_size = TRUE;
|
||||
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -570,6 +572,7 @@ gtk_socket_send_configure_event (GtkSocket *socket)
|
||||
{
|
||||
GtkAllocation allocation;
|
||||
XConfigureEvent xconfigure;
|
||||
GdkDisplay *display;
|
||||
gint x, y;
|
||||
|
||||
g_return_if_fail (socket->priv->plug_window != NULL);
|
||||
@ -584,9 +587,10 @@ gtk_socket_send_configure_event (GtkSocket *socket)
|
||||
* coordinates. We still aren't really ICCCM compliant, since
|
||||
* we don't send events when the real toplevel is moved.
|
||||
*/
|
||||
gdk_error_trap_push ();
|
||||
display = gdk_window_get_display (socket->priv->plug_window);
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
gdk_window_get_origin (socket->priv->plug_window, &x, &y);
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
|
||||
gtk_widget_get_allocation (GTK_WIDGET(socket), &allocation);
|
||||
xconfigure.x = x;
|
||||
@ -598,11 +602,11 @@ gtk_socket_send_configure_event (GtkSocket *socket)
|
||||
xconfigure.above = None;
|
||||
xconfigure.override_redirect = False;
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
XSendEvent (GDK_WINDOW_XDISPLAY (socket->priv->plug_window),
|
||||
GDK_WINDOW_XID (socket->priv->plug_window),
|
||||
False, NoEventMask, (XEvent *)&xconfigure);
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -632,7 +636,9 @@ gtk_socket_size_allocate (GtkWidget *widget,
|
||||
}
|
||||
else if (private->plug_window)
|
||||
{
|
||||
gdk_error_trap_push ();
|
||||
GdkDisplay *display = gdk_window_get_display (private->plug_window);
|
||||
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
|
||||
if (allocation->width != private->current_width ||
|
||||
allocation->height != private->current_height)
|
||||
@ -665,7 +671,7 @@ gtk_socket_size_allocate (GtkWidget *widget,
|
||||
allocation->width, allocation->height));
|
||||
}
|
||||
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -692,13 +698,13 @@ gtk_socket_send_key_event (GtkSocket *socket,
|
||||
xkey.keycode = gdk_event->key.hardware_keycode;
|
||||
xkey.same_screen = True;/* FIXME ? */
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (gdk_window_get_display (socket->priv->plug_window));
|
||||
XSendEvent (GDK_WINDOW_XDISPLAY (socket->priv->plug_window),
|
||||
GDK_WINDOW_XID (socket->priv->plug_window),
|
||||
False,
|
||||
(mask_key_presses ? KeyPressMask : NoEventMask),
|
||||
(XEvent *)&xkey);
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_x11_display_error_trap_pop_ignored (gdk_window_get_display (socket->priv->plug_window));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -1053,7 +1059,7 @@ gtk_socket_add_window (GtkSocket *socket,
|
||||
{
|
||||
g_warning (G_STRLOC ": Can't add non-GtkPlug to GtkSocket");
|
||||
private->plug_window = NULL;
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -1064,7 +1070,7 @@ gtk_socket_add_window (GtkSocket *socket,
|
||||
{
|
||||
GdkDragProtocol protocol;
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
|
||||
if (!private->plug_window)
|
||||
{
|
||||
@ -1072,16 +1078,16 @@ gtk_socket_add_window (GtkSocket *socket,
|
||||
private->plug_window = gdk_x11_window_foreign_new_for_display (display, xid);
|
||||
if (!private->plug_window) /* was deleted before we could get it */
|
||||
{
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
XSelectInput (GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (socket))),
|
||||
XSelectInput (GDK_DISPLAY_XDISPLAY (display),
|
||||
GDK_WINDOW_XID (private->plug_window),
|
||||
StructureNotifyMask | PropertyChangeMask);
|
||||
|
||||
if (gdk_error_trap_pop ())
|
||||
if (gdk_x11_display_error_trap_pop (display))
|
||||
{
|
||||
g_object_unref (private->plug_window);
|
||||
private->plug_window = NULL;
|
||||
@ -1090,7 +1096,7 @@ gtk_socket_add_window (GtkSocket *socket,
|
||||
|
||||
/* OK, we now will reliably get destroy notification on socket->plug_window */
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
|
||||
if (need_reparent)
|
||||
{
|
||||
@ -1119,26 +1125,25 @@ gtk_socket_add_window (GtkSocket *socket,
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
protocol = gdk_window_get_drag_protocol (private->plug_window, NULL);
|
||||
if (protocol)
|
||||
gtk_drag_dest_set_proxy (GTK_WIDGET (socket), private->plug_window,
|
||||
protocol, TRUE);
|
||||
gtk_drag_dest_set_proxy (widget, private->plug_window, protocol, TRUE);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
|
||||
gdk_window_add_filter (private->plug_window,
|
||||
gtk_socket_filter_func,
|
||||
socket);
|
||||
|
||||
#ifdef HAVE_XFIXES
|
||||
gdk_error_trap_push ();
|
||||
XFixesChangeSaveSet (GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (socket))),
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
XFixesChangeSaveSet (GDK_DISPLAY_XDISPLAY (display),
|
||||
GDK_WINDOW_XID (private->plug_window),
|
||||
SetModeInsert, SaveSetRoot, SaveSetUnmap);
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
#endif
|
||||
_gtk_xembed_send_message (private->plug_window,
|
||||
XEMBED_EMBEDDED_NOTIFY, 0,
|
||||
GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (socket))),
|
||||
GDK_WINDOW_XID (gtk_widget_get_window (widget)),
|
||||
private->xembed_version);
|
||||
|
||||
socket_update_active (socket);
|
||||
@ -1278,14 +1283,14 @@ xembed_get_info (GdkWindow *window,
|
||||
unsigned long *data_long;
|
||||
int status;
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
status = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
|
||||
GDK_WINDOW_XID (window),
|
||||
xembed_info_atom,
|
||||
0, 2, False,
|
||||
xembed_info_atom, &type, &format,
|
||||
&nitems, &bytes_after, &data);
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
|
||||
if (status != Success)
|
||||
return FALSE; /* Window vanished? */
|
||||
@ -1527,7 +1532,7 @@ gtk_socket_filter_func (GdkXEvent *gdk_xevent,
|
||||
else if ((xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (display, "XdndAware")) ||
|
||||
(xevent->xproperty.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);
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
protocol = gdk_window_get_drag_protocol (private->plug_window, NULL);
|
||||
if (protocol)
|
||||
@ -1536,7 +1541,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
protocol, TRUE);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
return_val = GDK_FILTER_REMOVE;
|
||||
}
|
||||
else if (xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (display, "_XEMBED_INFO"))
|
||||
@ -1554,9 +1559,9 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
gtk_socket_handle_map_request (socket);
|
||||
else
|
||||
{
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
gdk_window_show (private->plug_window);
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
|
||||
gtk_socket_unmap_notify (socket);
|
||||
}
|
||||
|
@ -161,11 +161,11 @@ _gtk_xembed_send_message (GdkWindow *recipient,
|
||||
xclient.data.l[3] = data1;
|
||||
xclient.data.l[4] = data2;
|
||||
|
||||
gdk_error_trap_push ();
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
XSendEvent (GDK_WINDOW_XDISPLAY(recipient),
|
||||
GDK_WINDOW_XID (recipient),
|
||||
False, NoEventMask, (XEvent *)&xclient);
|
||||
gdk_error_trap_pop_ignored ();
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user