[beryl-commits] r2227 - branches/beryl-plugins/group-tabbed

maniac at server.beryl-project.org maniac at server.beryl-project.org
Mon Jan 1 16:54:38 CET 2007


Author: maniac
Date: 2007-01-01 15:54:38 +0000 (Mon, 01 Jan 2007)
New Revision: 2227

Modified:
   branches/beryl-plugins/group-tabbed/group.c
   branches/beryl-plugins/group-tabbed/group.h
   branches/beryl-plugins/group-tabbed/init.c
Log:
group-tab-branch: revert r2225
indeed, both lastWidth/Height and oldWidth/Height are needed
- lastWidth/Height contain the width and height which will be current AFTER dequeueing all resize notifies
- oldWidth/Height contain width/height BEFORE dequeueing (as oldWidth/Height are updated in groupDequeueResizeNotifies)
- for constraining, we always need the latest coordinates -> lastWidth/Height, because if many resize requests are enqueued, oldWidth/Height don't reflect the real window state
- if you have a more elegant solution - feel free to implement it :-)


Modified: branches/beryl-plugins/group-tabbed/group.c
===================================================================
--- branches/beryl-plugins/group-tabbed/group.c	2007-01-01 15:42:02 UTC (rev 2226)
+++ branches/beryl-plugins/group-tabbed/group.c	2007-01-01 15:54:38 UTC (rev 2227)
@@ -710,13 +710,16 @@
 				}
 	
 				int nwidth, nheight;
-				if (constrainNewWindowSize(cw, gcw->oldWidth + rw, gcw->oldHeight + rh,
+				if (constrainNewWindowSize(cw, gcw->lastWidth + rw, gcw->lastHeight + rh,
 						&nwidth, &nheight)) {
-					rw = nwidth - gcw->oldWidth;
-					rh = nheight - gcw->oldHeight;
+					rw = nwidth - gcw->lastWidth;
+					rh = nheight - gcw->lastHeight;
 				}
 
 				groupEnqueueResizeNotify(cw, nx - WIN_X(cw), ny - WIN_Y(cw), rw, rh);
+
+				gcw->lastWidth = rw + WIN_WIDTH(cw);
+				gcw->lastHeight = rh + WIN_HEIGHT(cw);
 			}
 		}
 

Modified: branches/beryl-plugins/group-tabbed/group.h
===================================================================
--- branches/beryl-plugins/group-tabbed/group.h	2007-01-01 15:42:02 UTC (rev 2226)
+++ branches/beryl-plugins/group-tabbed/group.h	2007-01-01 15:54:38 UTC (rev 2227)
@@ -376,6 +376,10 @@
 	int oldX;
 	int oldY;
 
+	// for grouped resize
+	int lastWidth;
+	int lastHeight;
+
 	Bool needsPosSync;
 
 	GlowQuad *glowQuads;

Modified: branches/beryl-plugins/group-tabbed/init.c
===================================================================
--- branches/beryl-plugins/group-tabbed/init.c	2007-01-01 15:42:02 UTC (rev 2226)
+++ branches/beryl-plugins/group-tabbed/init.c	2007-01-01 15:54:38 UTC (rev 2227)
@@ -195,8 +195,8 @@
 	gw->inSelection = FALSE;
 
 	// for move/resize
-	gw->oldWidth = WIN_WIDTH(w);
-	gw->oldHeight = WIN_HEIGHT(w);
+	gw->oldWidth = gw->lastWidth = WIN_WIDTH(w);
+	gw->oldHeight = gw->lastHeight = WIN_HEIGHT(w);
 	gw->oldX = WIN_X(w);
 	gw->oldY = WIN_Y(w);
 




More information about the commits mailing list