[Xfce4-commits] r23601 - xfwm4/trunk/src

Olivier Fourdan olivier at xfce.org
Thu Nov 2 22:48:55 CET 2006


Author: olivier
Date: 2006-11-02 21:48:53 +0000 (Thu, 02 Nov 2006)
New Revision: 23601

Modified:
   xfwm4/trunk/src/client.c
   xfwm4/trunk/src/events.c
Log:
Re-enable XSync on apps that don't cooperate.

Modified: xfwm4/trunk/src/client.c
===================================================================
--- xfwm4/trunk/src/client.c	2006-11-02 21:18:29 UTC (rev 23600)
+++ xfwm4/trunk/src/client.c	2006-11-02 21:48:53 UTC (rev 23601)
@@ -1160,7 +1160,7 @@
     c = (Client *) data;
     if (c)
     {
-        g_warning ("XSync timeout for client \"%s\" (0x%lx)", c->name, c->window);
+        TRACE ("XSync timeout for client \"%s\" (0x%lx)", c->name, c->window);
         clientXSyncClearTimeout (c);
         c->xsync_waiting = FALSE;
         c->xsync_enabled = FALSE;
@@ -1207,6 +1207,30 @@
     clientXSyncResetTimeout (c);
     c->xsync_waiting = TRUE;
 }
+
+static gboolean
+clientXSyncEnable (Client * c)
+{
+    ScreenInfo *screen_info;
+    DisplayInfo *display_info;
+
+    g_return_val_if_fail (c != NULL, FALSE);
+
+    TRACE ("entering clientXSyncEnable");
+
+    screen_info = c->screen_info;
+    display_info = screen_info->display_info;
+
+    c->xsync_enabled = FALSE;
+    if (display_info->have_xsync)
+    {
+        if ((c->xsync_counter) && (c->xsync_alarm))
+        {
+            c->xsync_enabled = TRUE;
+        }
+    }
+    return (c->xsync_enabled);
+}
 #endif /* HAVE_XSYNC */
 
 static void
@@ -4439,6 +4463,10 @@
         poswinShow (passdata.poswin);
     }
 
+#ifdef HAVE_XSYNC
+    clientXSyncEnable (c);
+#endif /* HAVE_XSYNC */
+
     /* Set window translucent while resizing, doesn't looks too nice  :( */
     if ((screen_info->params->resize_opacity < 100) && !(screen_info->params->box_resize) && !(c->opacity_locked))
     {
@@ -4480,6 +4508,7 @@
     wc.height = c->height;
     clientConfigure (c, &wc, CWX | CWY | CWHeight | CWWidth, CFG_NOTIFY);
 #ifdef HAVE_XSYNC
+    clientXSyncClearTimeout (c);
     c->xsync_waiting = FALSE;
 #endif /* HAVE_XSYNC */
     myScreenUngrabKeyboard (screen_info, myDisplayGetCurrentTime (display_info));

Modified: xfwm4/trunk/src/events.c
===================================================================
--- xfwm4/trunk/src/events.c	2006-11-02 21:18:29 UTC (rev 23600)
+++ xfwm4/trunk/src/events.c	2006-11-02 21:48:53 UTC (rev 23601)
@@ -2248,9 +2248,9 @@
     if (c)
     {
         c->xsync_waiting = FALSE;
+        c->xsync_value = ev->counter_value;
         if (c->xsync_enabled)
         {
-            c->xsync_value = ev->counter_value;
             wc.x = c->x;
             wc.y = c->y;
             wc.width = c->width;



More information about the Xfce4-commits mailing list