Sam,

Since you asked I looked at the Put options I don't usually use and hooked
up Restore Position, Put Pointer, Put to Next Output, and Put to Adjacent
Viewport. I wasn't able to test Next Output but the others seem to work.
Patch is attached.

--
Jay
diff --git a/src/put.cpp b/src/put.cpp
index 929a101..752023f 100644
--- a/src/put.cpp
+++ b/src/put.cpp
@@ -620,23 +620,23 @@ PutScreen::getDistance (CompWindow         *w,
 	}
     case PutViewportLeft:
 	/* move to the viewport on the left */
-	dx = -s->width ();
+	dx = (s->vp ().x () >= 1) ? -s->width () : 0;
 	dy = 0;
 	break;
     case PutViewportRight:
 	/* move to the viewport on the right */
-	dx = s->width ();
+	dx = (s->vp ().x () < s->vpSize ().width ()-1) ? s->width () : 0;
 	dy = 0;
 	break;
     case PutViewportUp:
 	/* move to the viewport above */
 	dx = 0;
-	dy = -s->height ();
+	dy = (s->vp ().y () >= 1) ? -s->height () : 0;
 	break;
     case PutViewportDown:
 	/* move to the viewport below */
 	dx = 0;
-	dy = s->height ();
+	dy = (s->vp ().y () < s->vpSize ().height ()-1) ? s->height () : 0;
 	break;
     case PutNextOutput:
 	{
@@ -1214,6 +1214,9 @@ PutScreen::PutScreen (CompScreen *screen) :
     optionSet##action##ButtonInitiate (boost::bind (&PutScreen::initiateCommon,\
 					      this, _1,_2,_3,type))
 
+    setAction (PutRestore, PutRestore);
+    setAction (PutPointer, PutPointer);
+    setAction (PutNextOutput, PutNextOutput);
     setAction (PutCenter, PutCenter);
     setAction (PutEmptyCenter, PutEmptyCenter);
     setAction (PutLeft, PutLeft);
@@ -1250,12 +1253,14 @@ PutScreen::PutScreen (CompScreen *screen) :
     setViewportAction(11);
     setViewportAction(12);
 
-    /*
-    optionSetPutViewportInitiate (boost::bind (&PutScreen::initiateCommon,     \
-	                                  this, _1,_2,_3,(PutType)PutViewport));
-    optionSetPutViewport1KeyInitiate (boost::bind (&PutScreen::initiateCommon, \
-	                                  this, _1,_2,_3,(PutType)PutViewport));
-    */
+#define setDirectionAction(action) \
+    optionSet##action##KeyInitiate(boost::bind (&PutScreen::initiateCommon, \
+                                                this, _1,_2,_3,action))
+
+    setDirectionAction(PutViewportLeft);
+    setDirectionAction(PutViewportRight);
+    setDirectionAction(PutViewportUp);
+    setDirectionAction(PutViewportDown);
 }
 
 PutWindow::PutWindow (CompWindow *window) :
_______________________________________________
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz

Reply via email to