summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dodge.c21
-rw-r--r--dodge.xml.in6
2 files changed, 26 insertions, 1 deletions
diff --git a/dodge.c b/dodge.c
index 150e5ad..049845b 100644
--- a/dodge.c
+++ b/dodge.c
@@ -54,6 +54,7 @@ typedef struct _DodgeWindow
int pos; /* North South East West */
+ Bool selected;
Bool isdodge;
} DodgeWindow;
@@ -281,7 +282,7 @@ dodgeMarkDodgeWindows (CompScreen *s)
for (w = s->windows; w; w = w->next)
{
DODGE_WINDOW (w);
- if(matchEval(dodgeGetWindowTypes (s->display),w) &&
+ if((matchEval(dodgeGetWindowTypes (s->display),w) || dw->selected) &&
!(w->invisible || w->destroyed || w->hidden || w->minimized))
{
if (dw)
@@ -383,6 +384,22 @@ dodgePreparePaintScreen (CompScreen *s,
}
static Bool
+dodgeMark (CompDisplay *d,
+ CompAction *action,
+ CompActionState state,
+ CompOption *option,
+ int nOption)
+{
+ Window xid;
+ CompWindow *w;
+
+ xid = getIntOptionNamed (option, nOption, "window", 0);
+ w = findWindowAtDisplay (d, xid);
+ DODGE_WINDOW(w);
+ dw->selected = !dw->selected;
+ return TRUE;
+}
+static Bool
dodgeToggle (CompDisplay *d,
CompAction *action,
CompActionState state,
@@ -477,6 +494,7 @@ dodgeInitDisplay (CompPlugin *p,
dodgeSetDodgeToggleKeyInitiate (d, dodgeToggle);
dodgeSetDodgeToggleButtonInitiate (d, dodgeToggle);
dodgeSetDodgeToggleEdgeInitiate (d, dodgeToggle);
+ dodgeSetDodgeSelectKeyInitiate (d, dodgeMark);
dd->mpFunc = d->base.privates[mousepollindex].ptr;
return TRUE;
@@ -542,6 +560,7 @@ dodgeInitWindow (CompPlugin *p,
dw->vx = 0;
dw->vy = 0;
dw->isdodge = FALSE;
+ dw->selected = FALSE;
w->base.privates[ds->windowPrivateIndex].ptr = dw;
return TRUE;
diff --git a/dodge.xml.in b/dodge.xml.in
index c2fed20..89eaed7 100644
--- a/dodge.xml.in
+++ b/dodge.xml.in
@@ -39,6 +39,12 @@
<_long>Windows which should dodge</_long>
<default>state=above &amp; type=normal</default>
</option>
+ <option name="dodge_select_key" type="key">
+ <_short>Select Window</_short>
+ <_long>Mark the active window so it will
+ dodge</_long>
+ <default>none</default>
+ </option>
<option name="model" type="int">
<_short>Dodge Model</_short>
<_long>What model Dodge should use when dodging</_long>