Avoid triggering an X error when the client->manager_window is

Tue Feb 10 12:02:14 2004  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/xsettings-client.c (read_settings): Avoid
        triggering an X error when the client->manager_window
        is None...makes logs look cleaner.

        * gdk/x11/gdkproperty-x11.c (gdk_property_get): Handle
        GDK_NONE to mean AnyPropertyType as documented. (Reported
        by Yu Shao)

        * gdk/x11/gdkevents-x11.c (fetch_net_wm_check_window,
        gdk_x11_screen_get_window_manager_name): Fix error trap
        we've been leaking since 2002... (#129538)
This commit is contained in:
Owen Taylor 2004-02-10 18:51:19 +00:00 committed by Owen Taylor
parent 87c45c73b1
commit 351ebd8bd2
8 changed files with 105 additions and 23 deletions

View File

@ -1,3 +1,17 @@
Tue Feb 10 12:02:14 2004 Owen Taylor <otaylor@redhat.com>
* gdk/x11/xsettings-client.c (read_settings): Avoid
triggering an X error when the client->manager_window
is None...makes logs look cleaner.
* gdk/x11/gdkproperty-x11.c (gdk_property_get): Handle
GDK_NONE to mean AnyPropertyType as documented. (Reported
by Yu Shao)
* gdk/x11/gdkevents-x11.c (fetch_net_wm_check_window,
gdk_x11_screen_get_window_manager_name): Fix error trap
we've been leaking since 2002... (#129538)
2004-02-10 Federico Mena Quintero <federico@ximian.com>
Fixes the entry-related part of #133852.

View File

@ -1,3 +1,17 @@
Tue Feb 10 12:02:14 2004 Owen Taylor <otaylor@redhat.com>
* gdk/x11/xsettings-client.c (read_settings): Avoid
triggering an X error when the client->manager_window
is None...makes logs look cleaner.
* gdk/x11/gdkproperty-x11.c (gdk_property_get): Handle
GDK_NONE to mean AnyPropertyType as documented. (Reported
by Yu Shao)
* gdk/x11/gdkevents-x11.c (fetch_net_wm_check_window,
gdk_x11_screen_get_window_manager_name): Fix error trap
we've been leaking since 2002... (#129538)
2004-02-10 Federico Mena Quintero <federico@ximian.com>
Fixes the entry-related part of #133852.

View File

@ -1,3 +1,17 @@
Tue Feb 10 12:02:14 2004 Owen Taylor <otaylor@redhat.com>
* gdk/x11/xsettings-client.c (read_settings): Avoid
triggering an X error when the client->manager_window
is None...makes logs look cleaner.
* gdk/x11/gdkproperty-x11.c (gdk_property_get): Handle
GDK_NONE to mean AnyPropertyType as documented. (Reported
by Yu Shao)
* gdk/x11/gdkevents-x11.c (fetch_net_wm_check_window,
gdk_x11_screen_get_window_manager_name): Fix error trap
we've been leaking since 2002... (#129538)
2004-02-10 Federico Mena Quintero <federico@ximian.com>
Fixes the entry-related part of #133852.

View File

@ -1,3 +1,17 @@
Tue Feb 10 12:02:14 2004 Owen Taylor <otaylor@redhat.com>
* gdk/x11/xsettings-client.c (read_settings): Avoid
triggering an X error when the client->manager_window
is None...makes logs look cleaner.
* gdk/x11/gdkproperty-x11.c (gdk_property_get): Handle
GDK_NONE to mean AnyPropertyType as documented. (Reported
by Yu Shao)
* gdk/x11/gdkevents-x11.c (fetch_net_wm_check_window,
gdk_x11_screen_get_window_manager_name): Fix error trap
we've been leaking since 2002... (#129538)
2004-02-10 Federico Mena Quintero <federico@ximian.com>
Fixes the entry-related part of #133852.

View File

@ -1,3 +1,17 @@
Tue Feb 10 12:02:14 2004 Owen Taylor <otaylor@redhat.com>
* gdk/x11/xsettings-client.c (read_settings): Avoid
triggering an X error when the client->manager_window
is None...makes logs look cleaner.
* gdk/x11/gdkproperty-x11.c (gdk_property_get): Handle
GDK_NONE to mean AnyPropertyType as documented. (Reported
by Yu Shao)
* gdk/x11/gdkevents-x11.c (fetch_net_wm_check_window,
gdk_x11_screen_get_window_manager_name): Fix error trap
we've been leaking since 2002... (#129538)
2004-02-10 Federico Mena Quintero <federico@ximian.com>
Fixes the entry-related part of #133852.

View File

@ -2406,15 +2406,19 @@ fetch_net_wm_check_window (GdkScreen *screen)
/* Find out if this WM goes away, so we can reset everything. */
XSelectInput (screen_x11->xdisplay, *xwindow, StructureNotifyMask);
gdk_display_sync (display);
screen_x11->wmspec_check_window = *xwindow;
XFree (xwindow);
screen_x11->need_refetch_net_supported = TRUE;
screen_x11->need_refetch_wm_name = TRUE;
/* Careful, reentrancy */
_gdk_x11_screen_window_manager_changed (GDK_SCREEN (screen_x11));
if (gdk_error_trap_pop () == Success)
{
screen_x11->wmspec_check_window = *xwindow;
XFree (xwindow);
screen_x11->need_refetch_net_supported = TRUE;
screen_x11->need_refetch_wm_name = TRUE;
/* Careful, reentrancy */
_gdk_x11_screen_window_manager_changed (GDK_SCREEN (screen_x11));
}
}
/**
@ -2455,6 +2459,8 @@ gdk_x11_screen_get_window_manager_name (GdkScreen *screen)
guchar *name;
name = NULL;
gdk_error_trap_push ();
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (screen_x11->display),
screen_x11->wmspec_check_window,

View File

@ -505,7 +505,10 @@ gdk_property_get (GdkWindow *window,
display = gdk_drawable_get_display (window);
xproperty = gdk_x11_atom_to_xatom_for_display (display, property);
xtype = gdk_x11_atom_to_xatom_for_display (display, type);
if (type == GDK_NONE)
xtype = AnyPropertyType;
else
xtype = GDK_NONE;
ret_data = NULL;

View File

@ -373,24 +373,27 @@ read_settings (XSettingsClient *client)
XSettingsList *old_list = client->settings;
client->settings = NULL;
old_handler = XSetErrorHandler (ignore_errors);
result = XGetWindowProperty (client->display, client->manager_window,
client->xsettings_atom, 0, LONG_MAX,
False, client->xsettings_atom,
&type, &format, &n_items, &bytes_after, &data);
XSetErrorHandler (old_handler);
if (result == Success && type == client->xsettings_atom)
if (client->manager_window)
{
if (format != 8)
old_handler = XSetErrorHandler (ignore_errors);
result = XGetWindowProperty (client->display, client->manager_window,
client->xsettings_atom, 0, LONG_MAX,
False, client->xsettings_atom,
&type, &format, &n_items, &bytes_after, &data);
XSetErrorHandler (old_handler);
if (result == Success && type == client->xsettings_atom)
{
fprintf (stderr, "Invalid format for XSETTINGS property %d", format);
if (format != 8)
{
fprintf (stderr, "Invalid format for XSETTINGS property %d", format);
}
else
client->settings = parse_settings (data, n_items);
XFree (data);
}
else
client->settings = parse_settings (data, n_items);
XFree (data);
}
notify_changes (client, old_list);