[beryl-commits] r1503 - branches/beryl-group-with-tab-plugin

marex at server.beryl-project.org marex at server.beryl-project.org
Sat Dec 2 23:35:48 CET 2006


Author: marex
Date: 2006-12-02 23:35:47 +0100 (Sat, 02 Dec 2006)
New Revision: 1503

Modified:
   branches/beryl-group-with-tab-plugin/group.c
Log:
group-tab-branch: updating group-tab to new version: animation is now broken, but it unhooks the windows


Modified: branches/beryl-group-with-tab-plugin/group.c
===================================================================
--- branches/beryl-group-with-tab-plugin/group.c	2006-12-02 21:39:24 UTC (rev 1502)
+++ branches/beryl-group-with-tab-plugin/group.c	2006-12-02 22:35:47 UTC (rev 1503)
@@ -219,6 +219,7 @@
 
     WindowMoveNotifyProc        windowMoveNotify;
     WindowResizeNotifyProc      windowResizeNotify;
+	PreparePaintScreenProc             preparePaintScreen;
     PaintScreenProc             paintScreen;
     PaintWindowProc             paintWindow;
     PaintTransformedScreenProc  paintTransformedScreen; 
@@ -600,6 +601,33 @@
 }
 
 /*
+ * groupRemoveWindow
+ *
+ */
+static void
+groupUnhookWindow (CompWindow *w)
+{
+	//w->hidden = TRUE;
+    //hideWindow (w);
+
+    unhookWindowFromScreen (w->screen, w);
+ 
+    if (w->attrib.map_state == IsViewable && w->damaged)
+    {
+        if (w->type == CompWindowTypeDesktopMask)
+            w->screen->desktopWindowCount--;
+ 
+        if (w->struts)
+            updateWorkareaForScreen (w->screen);
+    }
+ 
+    updateClientListForScreen (w->screen);
+ 
+    if (!w->redirected)
+        w->screen->overlayWindowCount--;
+}
+
+/*
  * groupSyncWindows
  *
  */
@@ -1645,6 +1673,82 @@
     groupUpdatePosBuffer (w,  WIN_X (w), WIN_Y (w), WIN_WIDTH (w), WIN_HEIGHT (w));
 }
 
+/*
+ * groupDrawTabAnimation
+ *
+ */
+static void
+groupDrawTabAnimation (CompScreen *s)
+{
+	GROUP_SCREEN  (s);
+	GROUP_DISPLAY (s->display);
+
+	int index = groupFindGroupAtDisplay (gd, gd->animatedGroup);
+    if (index == -1)
+		return;
+
+    int stepX, stepY;
+    int i;
+    for (i = 0; i < gd->groups[index].nWins; i++)
+    {
+        CompWindow *cw = findWindowAtDisplay (s->display, gd->groups[index].windows[i]);
+        if(!cw)
+            continue;
+        GROUP_WINDOW (cw);
+
+        if (!gw->steps && gw->animate)
+        {
+           gw->animate = FALSE;
+           gd->animatedGroup = -1;
+
+           if (gd->groups[index].tabbed &&
+               gd->groups[index].topTab != NULL &&
+               gd->groups[index].topTab->id != cw->id)
+           { 
+				//cw->hidden = TRUE;
+				//hideWindow (cw);
+				syncWindowPosition (cw);
+				groupUnhookWindow (cw);
+				//unhookWindowFromScreen (s, cw);
+           }
+        }
+		
+        if (gw->animate)
+        {
+            stepX = (gw->destinationX - WIN_X (cw)) / gw->steps;
+            stepY = (gw->destinationY - WIN_Y (cw)) / gw->steps;
+            UNWRAP (gs, cw->screen, windowMoveNotify);
+            moveWindow (cw, stepX, stepY, TRUE, FALSE);
+            WRAP (gs, cw->screen, windowMoveNotify, groupWindowMoveNotify);
+          
+            gw->steps--;
+        }
+
+        // last window and animation has finished
+        if (i == gd->groups[index].nWins-1 && gd->animatedGroup == -1)
+        {
+            groupSyncWindows (s->display, gw->groupID);
+            raiseWindow (gd->groups[index].topTab);
+        }
+	}
+}
+
+/*
+ * groupPreparePaintScreen
+ *
+ */
+static void 
+groupPreparePaintScreen (CompScreen *s, int msSinceLastPaint)
+{
+	GROUP_SCREEN (s);
+
+	UNWRAP (gs, s, preparePaintScreen);
+    (*s->preparePaintScreen) (s, msSinceLastPaint);
+    WRAP (gs, s, preparePaintScreen, groupPreparePaintScreen);
+
+	groupDrawTabAnimation (s);
+}
+
 /* 
  * groupPaintScreen
  *
@@ -1655,7 +1759,6 @@
                  Region region, int output, unsigned int mask)
 {
     GROUP_SCREEN  (s);
-    GROUP_DISPLAY (s->display);
 
     Bool status;
     gs->wasTransformed = FALSE;
@@ -1699,55 +1802,11 @@
             glPopMatrix ();
         }
     }
-    else if (status)
-    {
-        int index = groupFindGroupAtDisplay (gd, gd->animatedGroup);
-        if (index == -1)
-            return status;
-    
-        int stepX, stepY;
-        int i;
-        for (i = 0; i < gd->groups[index].nWins; i++)
-        {
-            CompWindow *cw = findWindowAtDisplay (s->display, gd->groups[index].windows[i]);
-            if(!cw)
-                continue;
-            GROUP_WINDOW (cw);
+	else if (status)
+	{
+		//groupDrawTabAnimation (s);
+	}
 
-            if (!gw->steps && gw->animate)
-            {
-                gw->animate = FALSE;
-                gd->animatedGroup = -1;
-
-                if (gd->groups[index].tabbed &&
-                    gd->groups[index].topTab != NULL &&
-                    gd->groups[index].topTab->id != cw->id)
-                {
-                    cw->hidden = TRUE;
-                    hideWindow (cw);
-                }
-            }
-
-            if (gw->animate)
-            {
-                stepX = (gw->destinationX - WIN_X (cw)) / gw->steps;
-                stepY = (gw->destinationY - WIN_Y (cw)) / gw->steps;
-                UNWRAP (gs, cw->screen, windowMoveNotify);
-                moveWindow (cw, stepX, stepY, TRUE, FALSE);
-                WRAP (gs, cw->screen, windowMoveNotify, groupWindowMoveNotify);
-            
-                gw->steps--;
-            }
-
-            // last window and animation has finished
-            if (i == gd->groups[index].nWins-1 && gd->animatedGroup == -1)
-            {
-                groupSyncWindows (s->display, gw->groupID);
-                raiseWindow (gd->groups[index].topTab);
-            }
-        }
-    }
-
     return status;
 }
 
@@ -2219,6 +2278,7 @@
 
     WRAP (gs, s, windowMoveNotify,   groupWindowMoveNotify);
     WRAP (gs, s, windowResizeNotify, groupWindowResizeNotify);
+	WRAP (gs, s, preparePaintScreen, groupPreparePaintScreen);
     WRAP (gs, s, paintScreen, groupPaintScreen);
     WRAP (gs, s, paintWindow, groupPaintWindow);
     WRAP (gs, s, paintTransformedScreen, groupPaintTransformedScreen);
@@ -2252,6 +2312,7 @@
 
     UNWRAP (gs, s, windowMoveNotify);
     UNWRAP (gs, s, windowResizeNotify);
+	UNWRAP (gs, s, preparePaintScreen);
     UNWRAP (gs, s, paintScreen);
     UNWRAP (gs, s, paintWindow);
     UNWRAP (gs, s, paintTransformedScreen);




More information about the commits mailing list