diff options
author | Jay Catherwood <jay.catherwood@gmail.com> | 2010-10-30 23:21:59 -0400 |
---|---|---|
committer | Jay Catherwood <jay.catherwood@gmail.com> | 2010-10-30 23:21:59 -0400 |
commit | 12ffb0695a3ff2645d01d64eef692d911d07eeb3 (patch) | |
tree | ca05132530f5259914b86e13e09bb322d6de867b | |
parent | 5d8f7ad8a59435ca0410129a4f44d48085344aa3 (diff) | |
download | put-12ffb0695a3ff2645d01d64eef692d911d07eeb3.tar.gz put-12ffb0695a3ff2645d01d64eef692d911d07eeb3.tar.bz2 |
Activate remaining keybindings
This should fix "Restore Position", "Put Pointer",
"Put To Next Output", and "Put To Adjacent Viewport"
-rw-r--r-- | src/put.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/put.cpp b/src/put.cpp index 929a101..36c2222 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) : |