[fusion-commits] compiz mirror: Changes to 'master' (e3d0c46f80a09b710f46636b8288a7ae25dfac33)

compiz at server.beryl-project.org compiz at server.beryl-project.org
Thu Jul 26 01:46:04 CEST 2007


New commits:
commit e3d0c46f80a09b710f46636b8288a7ae25dfac33
Author: David Reveman <davidr at novell.com>
Date:   Wed Jul 25 17:07:27 2007 -0400

    Add lazy positioning option to move plugin and a bad
    implementation that will avoid a performance
    regression in upcoming release. The option should
    stay but the implementation should be replaced with
    a proper solution asap.


 metadata/move.xml.in |    5 +++++
 plugins/move.c       |   19 ++++++++++++++++---
 2 files changed, 21 insertions(+), 3 deletions(-)


Modified: compiz/metadata/move.xml.in
===================================================================
--- compiz/metadata/move.xml.in
+++ compiz/metadata/move.xml.in
@@ -29,6 +29,11 @@
 		<_long>Snapoff and auto unmaximized maximized windows when dragging</_long>
 		<default>true</default>
 	    </option>
+	    <option name="lazy_positioning" type="bool">
+		<_short>Lazy Positioning</_short>
+		<_long>Do not update the server-side position of windows until finished moving</_long>
+		<default>true</default>
+	    </option>
 	</display>
     </plugin>
 </compiz>

Modified: compiz/plugins/move.c
===================================================================
--- compiz/plugins/move.c
+++ compiz/plugins/move.c
@@ -57,7 +57,8 @@ static int displayPrivateIndex;
 #define MOVE_DISPLAY_OPTION_OPACITY	      1
 #define MOVE_DISPLAY_OPTION_CONSTRAIN_Y	      2
 #define MOVE_DISPLAY_OPTION_SNAPOFF_MAXIMIZED 3
-#define MOVE_DISPLAY_OPTION_NUM		      4
+#define MOVE_DISPLAY_OPTION_LAZY_POSITIONING  4
+#define MOVE_DISPLAY_OPTION_NUM		      5
 
 typedef struct _MoveDisplay {
     int		    screenPrivateIndex;
@@ -530,7 +531,18 @@ moveHandleMotionEvent (CompScreen *s,
 			wY + dy - w->attrib.y,
 			TRUE, FALSE);
 
-	    syncWindowPosition (w);
+	    if (md->opt[MOVE_DISPLAY_OPTION_LAZY_POSITIONING].value.b)
+	    {
+		/* FIXME: This form of lazy positioning is broken and should
+		   be replaced asap. Current code exists just to avoid a
+		   major performance regression in the 0.5.2 release. */
+		w->serverX = w->attrib.x;
+		w->serverY = w->attrib.y;
+	    }
+	    else
+	    {
+		syncWindowPosition (w);
+	    }
 
 	    md->x -= dx;
 	    md->y -= dy;
@@ -758,7 +770,8 @@ static const CompMetadataOptionInfo moveDisplayOptionInfo[] = {
     { "initiate", "action", 0, moveInitiate, moveTerminate },
     { "opacity", "int", "<min>0</min><max>100</max>", 0, 0 },
     { "constrain_y", "bool", 0, 0, 0 },
-    { "snapoff_maximized", "bool", 0, 0, 0 }
+    { "snapoff_maximized", "bool", 0, 0, 0 },
+    { "lazy_positioning", "bool", 0, 0, 0 }
 };
 
 static Bool


More information about the commits mailing list