summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Janlert <janlert@acc.umu.se>2008-11-17 17:11:20 +1100
committerMagnus Janlert <janlert@acc.umu.se>2008-11-17 17:46:47 +1100
commitfca996ed24dcb2c8fb98018eb55cd06a57b0d920 (patch)
treee81e18a520c3c8c5926720aac038dd6572b86731
parenta6dc2ce54ee59b092228633c4804e4102b117f28 (diff)
downloadvigo-fca996ed24dcb2c8fb98018eb55cd06a57b0d920.tar.gz
vigo-fca996ed24dcb2c8fb98018eb55cd06a57b0d920.tar.bz2
Add option for moving across viewportsHEADmaster
Patch from Teemu Hirsimäki which adds a new option over_edge. When enabled, it allows you to move to windows in other viewports as well.
-rw-r--r--vigo.c25
-rw-r--r--vigo.xml.in5
2 files changed, 27 insertions, 3 deletions
diff --git a/vigo.c b/vigo.c
index a76333a..c1c9d30 100644
--- a/vigo.c
+++ b/vigo.c
@@ -172,11 +172,21 @@ vigoGrabScreen (CompScreen *s,
static Bool
vigoIsCandidate (CompWindow *w)
{
+ Bool over_edge = vigoGetOverEdge (w->screen->display);
+
if (!w->mapNum || w->attrib.map_state != IsViewable)
return FALSE;
- if (w->invisible || w->hidden || w->minimized)
- return FALSE;
+ if (over_edge)
+ {
+ if (w->hidden || w->minimized)
+ return FALSE;
+ }
+ else
+ {
+ if (w->invisible || w->hidden || w->minimized)
+ return FALSE;
+ }
if (!(w->inputHint || (w->protocols & CompWindowProtocolTakeFocusMask)))
return FALSE;
@@ -190,7 +200,7 @@ vigoIsCandidate (CompWindow *w)
if (w->wmType & (CompWindowTypeDockMask | CompWindowTypeDesktopMask))
return FALSE;
- if (!(*w->screen->focusWindow) (w))
+ if (!over_edge && !(*w->screen->focusWindow) (w))
return FALSE;
if (!matchEval (vigoGetMoveMatch (w->screen->display), w))
@@ -848,6 +858,7 @@ vigoGoto (CompDisplay *d,
CompOption *option,
int nOption)
{
+ int x, y;
GET_DATA;
if (w)
{
@@ -861,7 +872,15 @@ vigoGoto (CompDisplay *d,
if (action == vigoGetMoveDown (w->screen->display))
nw = vigoGetWindow (w, VIGO_SOUTH);
if (nw)
+ {
moveInputFocusToWindow (nw);
+ // if its on another viewport, go there if over_edge is enabled
+ defaultViewportForWindow (nw, &x, &y);
+ Bool activate = (x != nw->screen->x || y != nw->screen->y);
+ Bool over_edge = vigoGetOverEdge (w->screen->display);
+ if (over_edge && activate)
+ (*nw->screen->activateWindow)(nw);
+ }
}
return TRUE;
diff --git a/vigo.xml.in b/vigo.xml.in
index 8519d1b..008a5ff 100644
--- a/vigo.xml.in
+++ b/vigo.xml.in
@@ -55,6 +55,11 @@
<_long>Windows we may go to </_long>
<default>type=Toolbar | Normal | Dialog | Utility | Unknown</default>
</option>
+ <option name="over_edge" type="bool">
+ <_short>Allow moving over edges</_short>
+ <_long>Allow going to windows outside the screen.</_long>
+ <default>false</default>
+ </option>
</group>
</display>
</plugin>