[beryl-commits] r2280 - branches/beryl-plugins/tile

pichalsi at server.beryl-project.org pichalsi at server.beryl-project.org
Tue Jan 2 15:34:21 CET 2007


Author: pichalsi
Date: 2007-01-02 14:34:21 +0000 (Tue, 02 Jan 2007)
New Revision: 2280

Modified:
   branches/beryl-plugins/tile/tile.c
Log:
beryl-plugins/tile: added basic multimonitor support

Modified: branches/beryl-plugins/tile/tile.c
===================================================================
--- branches/beryl-plugins/tile/tile.c	2007-01-02 14:31:18 UTC (rev 2279)
+++ branches/beryl-plugins/tile/tile.c	2007-01-02 14:34:21 UTC (rev 2280)
@@ -189,6 +189,21 @@
 	glRotatef((float)360/td->animationDuration*ts->msResizing, 0,0,1);
 	glTranslatef(-width/2, -height/2,0);
 	
+	/*
+	if (td->animationDuration / ts->msResizing > 2)
+	{
+		glTranslatef(x, y, -DEFAULT_Z_CAMERA);
+		glScalef(1.0f/sAttrib.xScale, 1.0f/sAttrib.yScale, 1.0f);
+		glRotatef(-5.0f/x, -5.0f/y, 1.0f, 0.0f);
+	}
+	else
+	{
+		glTranslatef(-x, -y, -DEFAULT_Z_CAMERA);
+		glScalef(1.0f/sAttrib.xScale, 1.0f/sAttrib.yScale, 1.0f);
+		glRotatef(5.0f/x, 5.0f/y, 1.0f, 0.0f);
+	}
+	*/
+	
 	(*s->drawWindow) (w, &sAttrib, region, mask | PAINT_WINDOW_TRANSFORMED_MASK);
 	
 	glPopMatrix();
@@ -639,18 +654,22 @@
 
 	if(ts->tiledCount>0)
 	{
+		int i = 0;
+		
+		XRectangle workArea;
+		screenGetOutputDevWorkArea(s, screenGetCurrentOutputDev(s), &workArea);
+		
 		int numWidth = ceil(sqrt(ts->tiledCount));
 		int numHeight = ceil((float)ts->tiledCount/numWidth);
 		
-		int height = (s->workArea.height - ts->decoHeight*numHeight)/numHeight;
-		int width = (s->workArea.width - ts->decoWidth*numWidth)/numWidth;
-
-		int i = 0;
+		int height = (workArea.height - ts->decoHeight*numHeight)/numHeight;
+		int width = (workArea.width - ts->decoWidth*numWidth)/numWidth;
+	
 		CompWindow *w = ts->firstTiled;
+		
+		int currentX = w->input.left + workArea.x;
+		int currentY = w->input.top + workArea.y;
 
-		int currentX = w->input.left + s->workArea.x;
-		int currentY = w->input.top + s->workArea.y;
-
 		while(w)
 		{
 			TILE_WINDOW(w);
@@ -664,11 +683,11 @@
 			
 			if(i%numWidth==0)
 			{
-				currentX = w->input.left;
+				currentX = w->input.left + workArea.x;
 				currentY += height + ts->decoHeight;
 			}
 			else
-				currentX+=width + ts->decoWidth;
+				currentX += width + ts->decoWidth;
 			
 			w = tw->next;
 		}
@@ -687,7 +706,10 @@
 	
 	if(ts->tiledCount>0)
 	{
-		int height=(s->workArea.height - ts->decoHeight*ts->tiledCount)/ts->tiledCount;
+		XRectangle workArea;
+		screenGetOutputDevWorkArea(s, screenGetCurrentOutputDev(s), &workArea);
+		
+		int height=(workArea.height - ts->decoHeight*ts->tiledCount)/ts->tiledCount;
 
 		int i = 0;	
 		CompWindow *w = ts->firstTiled;
@@ -695,9 +717,9 @@
 		while(w)
 		{
 			TILE_WINDOW(w);
-			int x = w->input.left + s->workArea.x;
-			int y = s->workArea.y + w->input.top*(i+1) + w->input.bottom*i + height*i;
-			int wid = s->workArea.width - w->input.left - w->input.right;
+			int x = w->input.left + workArea.x;
+			int y = workArea.y + w->input.top*(i+1) + w->input.bottom*i + height*i;
+			int wid = workArea.width - w->input.left - w->input.right;
 			int hei = height;
 			if(!tw->originalWidth || !tw->originalHeight)
 				saveCoords(w);
@@ -721,7 +743,10 @@
 
 	if(ts->tiledCount>0)
 	{
-		int width = (s->workArea.width - ts->decoWidth*ts->tiledCount)/ts->tiledCount;
+		XRectangle workArea;
+		screenGetOutputDevWorkArea(s, screenGetCurrentOutputDev(s), &workArea);
+		
+		int width = (workArea.width - ts->decoWidth*ts->tiledCount)/ts->tiledCount;
 
 		int i = 0;	
 		CompWindow *w = ts->firstTiled;
@@ -729,10 +754,10 @@
 		while(w)
 		{
 			TILE_WINDOW(w);
-			int x = s->workArea.x + w->input.left*(i+1) + w->input.right*i + width*i;
-			int y = w->input.top + s->workArea.y;
+			int x = workArea.x + w->input.left*(i+1) + w->input.right*i + width*i;
+			int y = w->input.top + workArea.y;
 			int wid = width;
-			int hei = s->workArea.height - w->input.top - w->input.bottom;
+			int hei = workArea.height - w->input.top - w->input.bottom;
 			if(!tw->originalWidth || !tw->originalHeight)
 				saveCoords(w);
 
@@ -758,13 +783,16 @@
 	{
 		int delta = td->opt[TILE_DISPLAY_OPTION_DELTA].value.i;
 		
-		int height = s->workArea.height - delta*(ts->tiledCount - 1) - ts->decoHeight;
-		int width = s->workArea.width - delta*(ts->tiledCount - 1) - ts->decoWidth;
+		XRectangle workArea;
+		screenGetOutputDevWorkArea(s, screenGetCurrentOutputDev(s), &workArea);
+		
+		int height = workArea.height - delta*(ts->tiledCount - 1) - ts->decoHeight;
+		int width = workArea.width - delta*(ts->tiledCount - 1) - ts->decoWidth;
 	
 		CompWindow *w = ts->firstTiled;
 		
-		int currentX = w->input.left + s->workArea.x;
-		int currentY = w->input.top + s->workArea.y;
+		int currentX = w->input.left + workArea.x;
+		int currentY = w->input.top + workArea.y;
 
 		while(w)
 		{




More information about the commits mailing list