Re: [compiz] [PATCH] Zoom only on manual rotate option

2007-07-16 Thread Treviño
Treviño ha scritto:
> This patch will add a new option (zoom_manual_only) in the rotate plugin
> that (by default) will make it zoom only on mouse initiate (so no more
> on d&d, window move and key-rotate)...
>
> Bye
>   
I've updated the patch against new git...
No chance to get it merged? :P

Treviño

-- 
Treviño's Blog - Life and Linux
http://3v1n0.tuxfamily.org/blog/

diff --git a/metadata/rotate.xml.in b/metadata/rotate.xml.in
index 83e4f03..4618795 100644
--- a/metadata/rotate.xml.in
+++ b/metadata/rotate.xml.in
@@ -269,6 +269,11 @@
 		2.0
 		0.1
 	
+	
+		<_short>Zoom only on Mouse Rotate
+		<_long>Zoom out only on mouse rotate.
+		true
+	
 	
 
 
diff --git a/plugins/rotate.c b/plugins/rotate.c
index 396f98e..e723b8a 100644
--- a/plugins/rotate.c
+++ b/plugins/rotate.c
@@ -95,7 +95,8 @@ typedef struct _RotateDisplay {
 #define ROTATE_SCREEN_OPTION_SPEED		 4
 #define ROTATE_SCREEN_OPTION_TIMESTEP		 5
 #define ROTATE_SCREEN_OPTION_ZOOM		 6
-#define ROTATE_SCREEN_OPTION_NUM		 7
+#define ROTATE_SCREEN_OPTION_ZOOM_MANUAL_ONLY	 7
+#define ROTATE_SCREEN_OPTION_NUM		 8
 
 typedef struct _RotateScreen {
 PreparePaintScreenProc	 preparePaintScreen;
@@ -411,7 +412,8 @@ rotatePreparePaintScreen (CompScreen *s,
 	}
 }
 
-if (rs->moving && cs->invert == 1 && !cs->unfolded)
+if (rs->moving && cs->invert == 1 && !cs->unfolded &&
+	!rs->opt[ROTATE_SCREEN_OPTION_ZOOM_MANUAL_ONLY].value.b)
 {
 	if (fabs(rs->xrot + rs->baseXrot + rs->moveTo) <=
 	(360.0 / (s->hsize * 2.0)))
@@ -1752,7 +1754,8 @@ static const CompMetadataOptionInfo rotateScreenOptionInfo[] = {
 { "snap_top", "bool", 0, 0, 0 },
 { "speed", "float", "0.1", 0, 0 },
 { "timestep", "float", "0.1", 0, 0 },
-{ "zoom", "float", 0, 0, 0 }
+{ "zoom", "float", 0, 0, 0 },
+{ "zoom_manual_only", "bool", 0, 0, 0 }
 };
 
 static Bool
___
compiz mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] [PATCH] Zoom only on manual rotate option

2007-06-22 Thread Treviño
This patch will add a new option (zoom_manual_only) in the rotate plugin
that (by default) will make it zoom only on mouse initiate (so no more
on d&d, window move and key-rotate)...

Bye

-- 
Treviño's Blog - Life and Linux
http://3v1n0.tuxfamily.org/blog/

diff --git a/metadata/rotate.xml.in b/metadata/rotate.xml.in
index 23c11b2..d0a2fb1 100644
--- a/metadata/rotate.xml.in
+++ b/metadata/rotate.xml.in
@@ -269,7 +269,11 @@
 		2.0
 		0.1
 	
-
+	
+		Zoom only on Mouse Rotate
+		Zoom out only on mouse rotate.
+		true
+	
 	
 
 
diff --git a/plugins/rotate.c b/plugins/rotate.c
index 396f98e..e723b8a 100644
--- a/plugins/rotate.c
+++ b/plugins/rotate.c
@@ -95,7 +95,8 @@ typedef struct _RotateDisplay {
 #define ROTATE_SCREEN_OPTION_SPEED		 4
 #define ROTATE_SCREEN_OPTION_TIMESTEP		 5
 #define ROTATE_SCREEN_OPTION_ZOOM		 6
-#define ROTATE_SCREEN_OPTION_NUM		 7
+#define ROTATE_SCREEN_OPTION_ZOOM_MANUAL_ONLY	 7
+#define ROTATE_SCREEN_OPTION_NUM		 8
 
 typedef struct _RotateScreen {
 PreparePaintScreenProc	 preparePaintScreen;
@@ -411,7 +412,8 @@ rotatePreparePaintScreen (CompScreen *s,
 	}
 }
 
-if (rs->moving && cs->invert == 1 && !cs->unfolded)
+if (rs->moving && cs->invert == 1 && !cs->unfolded &&
+	!rs->opt[ROTATE_SCREEN_OPTION_ZOOM_MANUAL_ONLY].value.b)
 {
 	if (fabs(rs->xrot + rs->baseXrot + rs->moveTo) <=
 	(360.0 / (s->hsize * 2.0)))
@@ -1752,7 +1754,8 @@ static const CompMetadataOptionInfo rotateScreenOptionInfo[] = {
 { "snap_top", "bool", 0, 0, 0 },
 { "speed", "float", "0.1", 0, 0 },
 { "timestep", "float", "0.1", 0, 0 },
-{ "zoom", "float", 0, 0, 0 }
+{ "zoom", "float", 0, 0, 0 },
+{ "zoom_manual_only", "bool", 0, 0, 0 }
 };
 
 static Bool
___
compiz mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/compiz