summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2007-10-04 07:28:47 +0200
committerDanny Baumann <dannybaumann@web.de>2007-10-04 07:28:47 +0200
commitbc445614461feae49bd368571a295d2b74a6f3a2 (patch)
treea689d291bef579bdd0d0d5c521b481592a9da274
parent4bc9aff2182c378632e5d52967cbb60502201365 (diff)
downloadgroup-bc445614461feae49bd368571a295d2b74a6f3a2.tar.gz
group-bc445614461feae49bd368571a295d2b74a6f3a2.tar.bz2
Use central function to determine if a window should be groupable or not.
Filter out desktop and override_redirect windows.
-rw-r--r--group-internal.h3
-rw-r--r--group.c31
-rw-r--r--init.c3
-rw-r--r--selection.c5
4 files changed, 31 insertions, 11 deletions
diff --git a/group-internal.h b/group-internal.h
index 8cf49b3..e89de89 100644
--- a/group-internal.h
+++ b/group-internal.h
@@ -484,6 +484,9 @@ typedef struct _GroupWindow {
* group.c
*/
+Bool
+groupIsGroupWindow (CompWindow *w);
+
void
groupUpdateWindowProperty (CompWindow *w);
diff --git a/group.c b/group.c
index 47d2cee..29cb7e2 100644
--- a/group.c
+++ b/group.c
@@ -25,6 +25,28 @@
#include "group-internal.h"
/*
+ * groupIsGroupWindow
+ *
+ */
+Bool
+groupIsGroupWindow (CompWindow *w)
+{
+ if (w->attrib.override_redirect)
+ return FALSE;
+
+ if (w->type & CompWindowTypeDesktopMask)
+ return FALSE;
+
+ if (w->invisible)
+ return FALSE;
+
+ if (!matchEval (groupGetWindowMatch (w->screen), w))
+ return FALSE;
+
+ return TRUE;
+}
+
+/*
* groupDragHoverTimeout
*
* Description:
@@ -453,8 +475,7 @@ groupRemoveWindowFromGroup (CompWindow *w)
/* no tab bar - delete immediately */
groupDeleteGroupWindow (w);
- if (groupGetAutotabCreate (w->screen) &&
- matchEval (groupGetWindowMatch (w->screen), w))
+ if (groupGetAutotabCreate (w->screen) && groupIsGroupWindow (w))
{
groupAddWindowToGroup (w, NULL, 0);
groupTabGroup (w);
@@ -498,8 +519,7 @@ groupDeleteGroup (GroupSelection *group)
updateWindowOutputExtents (cw);
groupUpdateWindowProperty (cw);
- if (groupGetAutotabCreate (s) &&
- matchEval (groupGetWindowMatch (s), cw))
+ if (groupGetAutotabCreate (s) && groupIsGroupWindow (cw))
{
groupAddWindowToGroup (cw, NULL, 0);
groupTabGroup (cw);
@@ -1997,8 +2017,7 @@ groupDamageWindowRect (CompWindow *w,
if (initial)
{
- if (groupGetAutotabCreate (s) &&
- matchEval (groupGetWindowMatch (s), w))
+ if (groupGetAutotabCreate (s) && groupIsGroupWindow (w))
{
if (!gw->group && (gw->windowState == WindowNormal))
{
diff --git a/init.c b/init.c
index bd5ea45..8b3e7ef 100644
--- a/init.c
+++ b/init.c
@@ -172,8 +172,7 @@ groupApplyInitialActions (void *closure)
damageScreen (w->screen);
}
- if (groupGetAutotabCreate (s) && !w->invisible &&
- matchEval (groupGetWindowMatch (s), w))
+ if (groupGetAutotabCreate (s) && groupIsGroupWindow (w))
{
if (!gw->group && (gw->windowState == WindowNormal))
{
diff --git a/selection.c b/selection.c
index 1b8fc6e..b010f08 100644
--- a/selection.c
+++ b/selection.c
@@ -101,8 +101,7 @@ groupFindWindowsInRegion (CompScreen *s,
for (w = s->reverseWindows; w; w = w->prev)
{
- if (matchEval (groupGetWindowMatch (s), w) &&
- !w->invisible &&
+ if (groupIsGroupWindow (w) &&
groupWindowInRegion (w, reg, precision))
{
GROUP_WINDOW (w);
@@ -185,7 +184,7 @@ groupSelectWindow (CompWindow *w)
GROUP_WINDOW (w);
/* filter out windows we don't want to be groupable */
- if (w->invisible || !matchEval (groupGetWindowMatch (w->screen), w))
+ if (!groupIsGroupWindow (w))
return;
if (gw->inSelection)