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