gtk+ r22057 - in branches/gtk-2-14: . gdk/x11
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r22057 - in branches/gtk-2-14: . gdk/x11
- Date: Sun, 4 Jan 2009 04:48:40 +0000 (UTC)
Author: matthiasc
Date: Sun Jan 4 04:48:40 2009
New Revision: 22057
URL: http://svn.gnome.org/viewvc/gtk+?rev=22057&view=rev
Log:
* gdk/x11/gdkscreen-x11.h:
* gdk/x11/gdkevents-x11.c (fetch_net_wm_check_window): Recheck
_NET_SUPPORTING_WM_CHECK every now and then to avoid getting
stuck on the id of a former wmcheck window that got reused by
another client (see RH bug 471927)
Modified:
branches/gtk-2-14/ChangeLog
branches/gtk-2-14/gdk/x11/gdkevents-x11.c
branches/gtk-2-14/gdk/x11/gdkscreen-x11.h
Modified: branches/gtk-2-14/gdk/x11/gdkevents-x11.c
==============================================================================
--- branches/gtk-2-14/gdk/x11/gdkevents-x11.c (original)
+++ branches/gtk-2-14/gdk/x11/gdkevents-x11.c Sun Jan 4 04:48:40 2009
@@ -2614,23 +2614,20 @@
gulong bytes_after;
guchar *data;
Window *xwindow;
-
- /* This function is very slow on every call if you are not running a
- * spec-supporting WM. For now not optimized, because it isn't in
- * any critical code paths, but if you used it somewhere that had to
- * be fast you want to avoid "GTK is slow with old WMs" complaints.
- * Probably at that point the function should be changed to query
- * _NET_SUPPORTING_WM_CHECK only once every 10 seconds or something.
- */
+ GTimeVal tv;
screen_x11 = GDK_SCREEN_X11 (screen);
display = screen_x11->display;
g_return_if_fail (GDK_DISPLAY_X11 (display)->trusted_client);
- if (screen_x11->wmspec_check_window != None)
- return; /* already have it */
-
+ g_get_current_time (&tv);
+
+ if (ABS (tv.tv_sec - screen_x11->last_wmspec_check_time) < 15)
+ return; /* we've checked recently */
+
+ screen_x11->last_wmspec_check_time = tv.tv_sec;
+
data = NULL;
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), screen_x11->xroot_window,
gdk_x11_get_xatom_by_name_for_display (display, "_NET_SUPPORTING_WM_CHECK"),
@@ -2646,6 +2643,12 @@
xwindow = (Window *)data;
+ if (screen_x11->wmspec_check_window == *xwindow)
+ {
+ XFree (xwindow);
+ return;
+ }
+
gdk_error_trap_push ();
/* Find out if this WM goes away, so we can reset everything. */
Modified: branches/gtk-2-14/gdk/x11/gdkscreen-x11.h
==============================================================================
--- branches/gtk-2-14/gdk/x11/gdkscreen-x11.h (original)
+++ branches/gtk-2-14/gdk/x11/gdkscreen-x11.h Sun Jan 4 04:48:40 2009
@@ -57,6 +57,7 @@
GdkWindow *root_window;
/* Window manager */
+ long last_wmspec_check_time;
Window wmspec_check_window;
char *window_manager_name;
/* TRUE if wmspec_check_window has changed since last
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]