mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 14:00:09 +00:00
Try to fix #315732, reported by Luke Hutchinson:
2007-01-02 Matthias Clasen <mclasen@redhat.com> Try to fix #315732, reported by Luke Hutchinson: * gdk/x11/xsettings-client.[hc]: * gdk/x11/gdkdevents-x11.c: Don't assume that ref'ing a GdkWindow will guarantee that it can be looked up in the xid hash later. Also, use the nesting server grab function during the xsettings client initialization. Finally, make xsettings client not eat DestroyNotifys so that GDK can do its regular cleanup. svn path=/trunk/; revision=17022
This commit is contained in:
parent
4bf5344e3d
commit
129ad4b48d
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
||||
2007-01-02 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Try to fix #315732, reported by Luke Hutchinson:
|
||||
|
||||
* gdk/x11/xsettings-client.[hc]:
|
||||
* gdk/x11/gdkdevents-x11.c: Don't assume that ref'ing a GdkWindow
|
||||
will guarantee that it can be looked up in the xid hash later.
|
||||
Also, use the nesting server grab function during the xsettings
|
||||
client initialization. Finally, make xsettings client not
|
||||
eat DestroyNotifys so that GDK can do its regular cleanup.
|
||||
|
||||
2007-01-02 Michael Natterer <mitch@imendio.com>
|
||||
|
||||
* gtk/gtkrange.c (gtk_range_scroll) (gtk_range_move_slider): beep
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
||||
* Modified by the GTK+ Team and others 1997-2007. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
@ -177,15 +177,13 @@ _gdk_x11_events_init_screen (GdkScreen *screen)
|
||||
/* Keep a flag to avoid extra notifies that we don't need
|
||||
*/
|
||||
screen_x11->xsettings_in_init = TRUE;
|
||||
screen_x11->xsettings_client = xsettings_client_new (screen_x11->xdisplay,
|
||||
screen_x11->screen_num,
|
||||
gdk_xsettings_notify_cb,
|
||||
gdk_xsettings_watch_cb,
|
||||
screen);
|
||||
xsettings_client_set_grab_func (screen_x11->xsettings_client,
|
||||
refcounted_grab_server);
|
||||
xsettings_client_set_ungrab_func (screen_x11->xsettings_client,
|
||||
refcounted_ungrab_server);
|
||||
screen_x11->xsettings_client = xsettings_client_new_with_grab_funcs (screen_x11->xdisplay,
|
||||
screen_x11->screen_num,
|
||||
gdk_xsettings_notify_cb,
|
||||
gdk_xsettings_watch_cb,
|
||||
screen,
|
||||
refcounted_grab_server,
|
||||
refcounted_ungrab_server);
|
||||
screen_x11->xsettings_in_init = FALSE;
|
||||
}
|
||||
|
||||
@ -3008,16 +3006,13 @@ gdk_xsettings_watch_cb (Window window,
|
||||
{
|
||||
if (!gdkwin)
|
||||
gdkwin = gdk_window_foreign_new_for_display (gdk_screen_get_display (screen), window);
|
||||
else
|
||||
g_object_ref (gdkwin);
|
||||
|
||||
gdk_window_add_filter (gdkwin, gdk_xsettings_client_event_filter, screen);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_assert (gdkwin);
|
||||
gdk_window_remove_filter (gdkwin, gdk_xsettings_client_event_filter, screen);
|
||||
g_object_unref (gdkwin);
|
||||
if (gdkwin)
|
||||
gdk_window_remove_filter (gdkwin, gdk_xsettings_client_event_filter, screen);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2001 Red Hat, Inc.
|
||||
* Copyright © 2001, 2007 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
@ -454,6 +454,19 @@ xsettings_client_new (Display *display,
|
||||
XSettingsNotifyFunc notify,
|
||||
XSettingsWatchFunc watch,
|
||||
void *cb_data)
|
||||
{
|
||||
return xsettings_client_new_with_grab_funcs (display, screen, notify, watch, cb_data,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
XSettingsClient *
|
||||
xsettings_client_new_with_grab_funcs (Display *display,
|
||||
int screen,
|
||||
XSettingsNotifyFunc notify,
|
||||
XSettingsWatchFunc watch,
|
||||
void *cb_data,
|
||||
XSettingsGrabFunc grab,
|
||||
XSettingsGrabFunc ungrab)
|
||||
{
|
||||
XSettingsClient *client;
|
||||
char buffer[256];
|
||||
@ -469,8 +482,8 @@ xsettings_client_new (Display *display,
|
||||
client->notify = notify;
|
||||
client->watch = watch;
|
||||
client->cb_data = cb_data;
|
||||
client->grab = NULL;
|
||||
client->ungrab = NULL;
|
||||
client->grab = grab;
|
||||
client->ungrab = ungrab;
|
||||
|
||||
client->manager_window = None;
|
||||
client->settings = NULL;
|
||||
@ -505,6 +518,7 @@ xsettings_client_new (Display *display,
|
||||
return client;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
xsettings_client_set_grab_func (XSettingsClient *client,
|
||||
XSettingsGrabFunc grab)
|
||||
@ -571,7 +585,8 @@ xsettings_client_process_event (XSettingsClient *client,
|
||||
if (xev->xany.type == DestroyNotify)
|
||||
{
|
||||
check_manager_window (client);
|
||||
return True;
|
||||
/* let GDK do its cleanup */
|
||||
return False;
|
||||
}
|
||||
else if (xev->xany.type == PropertyNotify)
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2001 Red Hat, Inc.
|
||||
* Copyright © 2001, 2007 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
@ -54,6 +54,13 @@ XSettingsClient *xsettings_client_new (Display *display,
|
||||
XSettingsNotifyFunc notify,
|
||||
XSettingsWatchFunc watch,
|
||||
void *cb_data);
|
||||
XSettingsClient *xsettings_client_new_with_grab_funcs (Display *display,
|
||||
int screen,
|
||||
XSettingsNotifyFunc notify,
|
||||
XSettingsWatchFunc watch,
|
||||
void *cb_data,
|
||||
XSettingsGrabFunc grab,
|
||||
XSettingsGrabFunc ungrab);
|
||||
void xsettings_client_set_grab_func (XSettingsClient *client,
|
||||
XSettingsGrabFunc grab);
|
||||
void xsettings_client_set_ungrab_func (XSettingsClient *client,
|
||||
|
Loading…
Reference in New Issue
Block a user