rpms/gtk2/F-10 wmspec-recheck.patch,NONE,1.1 gtk2.spec,1.338,1.339

Matthias Clasen mclasen at fedoraproject.org
Sun Jan 4 02:50:03 UTC 2009


Author: mclasen

Update of /cvs/pkgs/rpms/gtk2/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11584

Modified Files:
	gtk2.spec 
Added Files:
	wmspec-recheck.patch 
Log Message:
recheck _NET_SUPPORTING_WM_CHECK every now and then


wmspec-recheck.patch:

--- NEW FILE wmspec-recheck.patch ---
Index: gdk/x11/gdkscreen-x11.h
===================================================================
--- gdk/x11/gdkscreen-x11.h	(revision 22048)
+++ gdk/x11/gdkscreen-x11.h	(working copy)
@@ -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
Index: gdk/x11/gdkevents-x11.c
===================================================================
--- gdk/x11/gdkevents-x11.c	(revision 22048)
+++ gdk/x11/gdkevents-x11.c	(working copy)
@@ -2614,23 +2614,20 @@
   gulong bytes_after;
   guchar *data;
   Window *xwindow;
+  GTimeVal tv;
   
-  /* 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.
-   */
-  
   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. */


Index: gtk2.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gtk2/F-10/gtk2.spec,v
retrieving revision 1.338
retrieving revision 1.339
diff -u -r1.338 -r1.339
--- gtk2.spec	12 Dec 2008 22:55:19 -0000	1.338
+++ gtk2.spec	4 Jan 2009 02:49:32 -0000	1.339
@@ -16,7 +16,7 @@
 Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
 Name: gtk2
 Version: %{base_version}
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: LGPLv2+
 Group: System Environment/Libraries
 Source: http://download.gnome.org/sources/gtk+/2.14/gtk+-%{version}.tar.bz2
@@ -32,6 +32,8 @@
 Patch2: workaround.patch
 # from upstream
 Patch3: missing-compose-seqs.patch
+#
+Patch4: wmspec-recheck.patch
 
 BuildRequires: atk-devel >= %{atk_version}
 BuildRequires: pango-devel >= %{pango_version}
@@ -119,6 +121,7 @@
 %patch1 -p1 -b .set-invisible-char-to-bullet
 %patch2 -p1 -b .workaround
 %patch3 -p1 -b .missing-compose-seqs
+%patch4 -p0 -b .wmspec-recheck
 
 for i in config.guess config.sub ; do
   test -f %{_datadir}/libtool/$i && cp %{_datadir}/libtool/$i .
@@ -300,6 +303,9 @@
 %{_datadir}/gtk-2.0
 
 %changelog
+* Sat Jan  3 2009 Matthias Clasen <mclasen at redhat.com> - 2.14.5-4
+- Recheck _NET_SUPPORTING_WM_CHECK every now and then
+
 * Thu Nov 27 2008 Matthias Clasen <mclasen at redhat.com> - 2.14.5-3
 - Make dead keys work again
 




More information about the fedora-extras-commits mailing list