summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2007-04-04 10:16:40 +0200
committerDanny Baumann <dannybaumann@web.de>2007-04-04 10:16:40 +0200
commitda3163c9d6ec072841b7473890cbc50c10b3df33 (patch)
tree7c46751d0ed89663cd6f9067a5efb3bf3d599df9
parent3eafa3ee97f73e605549a857584d31ee993deed4 (diff)
downloadberyl-premerge-da3163c9d6ec072841b7473890cbc50c10b3df33.tar.gz
beryl-premerge-da3163c9d6ec072841b7473890cbc50c10b3df33.tar.bz2
trailfocus: damage window when its trailfocus state changed (if it was a trailfocus window and now isn't and vice versa)
-rw-r--r--src/trailfocus.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/trailfocus.c b/src/trailfocus.c
index fc3ac7b..621a705 100644
--- a/src/trailfocus.c
+++ b/src/trailfocus.c
@@ -88,6 +88,7 @@ typedef struct _TrailfocusWindow
static void setWindows(CompScreen * s)
{
CompWindow *w;
+ Bool wasTfWindow;
TRAILFOCUS_SCREEN(s);
int i = 0;
@@ -96,24 +97,31 @@ static void setWindows(CompScreen * s)
for (w = s->windows; w; w = w->next)
{
TRAILFOCUS_WINDOW(w);
- tw->isTfWindow = FALSE;
+ wasTfWindow = tw->isTfWindow;
+ tw->isTfWindow = TRUE;
if (w->invisible || w->hidden || w->minimized)
- continue;
-
- if (!matchEval(trailfocusGetWindowMatch(s), w))
- continue;
+ tw->isTfWindow = FALSE;
+ else if (!matchEval(trailfocusGetWindowMatch(s), w))
+ tw->isTfWindow = FALSE;
- for (i = 0; i < winMax; i++)
- if (w->id == ts->win[i])
- break;
+ if (wasTfWindow && !tw->isTfWindow)
+ addWindowDamage(w);
- tw->isTfWindow = TRUE;
+ if (tw->isTfWindow)
+ {
+ for (i = 0; i < winMax; i++)
+ if (w->id == ts->win[i])
+ break;
- if (memcmp(&tw->attribs, &ts->inc[i], sizeof(TfAttrib)) != 0)
- addWindowDamage(w);
+ if (!wasTfWindow ||
+ (memcmp(&tw->attribs, &ts->inc[i], sizeof(TfAttrib)) != 0))
+ {
+ addWindowDamage(w);
+ }
- tw->attribs = ts->inc[i];
+ tw->attribs = ts->inc[i];
+ }
}
}