summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/neg.c
diff options
context:
space:
mode:
authorkristian <kristian@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-19 20:26:14 +0000
committerkristian <kristian@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-19 20:26:14 +0000
commitca0e3486e1bab65c232b1f5774f345b01636e57b (patch)
tree0445006eca762d8d101319da01173bbe9ad5db19 /beryl-plugins/src/neg.c
parentd6ba7084fe9f909ab13b8a3c61ce2a26f1707b54 (diff)
downloadmarex-dev-ca0e3486e1bab65c232b1f5774f345b01636e57b.tar.gz
marex-dev-ca0e3486e1bab65c232b1f5774f345b01636e57b.tar.bz2
trunk: neg.c:
- Option to exclude when WM_CLASS isn't set (NULL), patch by atie, closes #265 (... only posted a month ago O_o) - Changed option-grouping to make more sense. git-svn-id: file:///beryl/trunk@2900 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/neg.c')
-rw-r--r--beryl-plugins/src/neg.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/beryl-plugins/src/neg.c b/beryl-plugins/src/neg.c
index bcecd0c..1e9ca77 100644
--- a/beryl-plugins/src/neg.c
+++ b/beryl-plugins/src/neg.c
@@ -56,9 +56,12 @@ static char *excludeWinType[] = {
#define NEG_DISPLAY_OPTION_SCREEN_TOGGLE 1
#define NEG_DISPLAY_OPTION_NUM 2
-#define NEG_SCREEN_OPTION_EXCLUDE_WINDOW_TYPE 0
-#define NEG_SCREEN_OPTION_EXCLUDE_LIST 1
-#define NEG_SCREEN_OPTION_NUM 2
+#define NEG_SCREEN_OPTION_EXCLUDE_NULL_WM_CLASS 0
+#define NEG_SCREEN_OPTION_EXCLUDE_WINDOW_TYPE 1
+#define NEG_SCREEN_OPTION_EXCLUDE_LIST 2
+#define NEG_SCREEN_OPTION_NUM 3
+
+#define NEG_EXCLUDE_NULL_WM_CLASS_DEFAULT FALSE
static int displayPrivateIndex;
@@ -105,6 +108,10 @@ static void NEGToggle(CompWindow * w)
nw->isNeg = !nw->isNeg;
/* check exclude list */
+ if (ns->opt[NEG_SCREEN_OPTION_EXCLUDE_NULL_WM_CLASS].value.b &&
+ (w->resClass == NULL))
+ nw->isNeg = FALSE;
+
if (ns->excludeWMask & w->type)
nw->isNeg = FALSE;
@@ -630,11 +637,22 @@ static void NEGScreenInitOptions(NEGScreen * ns)
CompOption *o;
unsigned int i;
+ o = &ns->opt[NEG_SCREEN_OPTION_EXCLUDE_NULL_WM_CLASS];
+ o->advanced = True;
+ o->name = "exclude_null_wm_class";
+ o->group = N_("Exclusions");
+ o->subGroup = N_("");
+ o->displayHints = "";
+ o->shortDesc = N_("Exclude Null WM_CLASS");
+ o->longDesc = N_("Exclude to negate if WM_CLASS is Null");
+ o->type = CompOptionTypeBool;
+ o->value.b = NEG_EXCLUDE_NULL_WM_CLASS_DEFAULT;
+
o = &ns->opt[NEG_SCREEN_OPTION_EXCLUDE_WINDOW_TYPE];
o->advanced = False;
o->name = "exclude_window_types";
- o->group = N_("Misc. options");
- o->subGroup = N_("Exclusions");
+ o->group = N_("Exclusions");
+ o->subGroup = N_("");
o->displayHints = "";
o->shortDesc = N_("Exclude Window Types");
o->longDesc = N_("Window types that should not be negated");
@@ -653,8 +671,8 @@ static void NEGScreenInitOptions(NEGScreen * ns)
o = &ns->opt[NEG_SCREEN_OPTION_EXCLUDE_LIST];
o->advanced = False;
o->name = "exclude_list";
- o->group = N_("Misc. options");
- o->subGroup = N_("Exclusions");
+ o->group = N_("Exclusions");
+ o->subGroup = N_("");
o->displayHints = "";
o->shortDesc = N_("WM_CLASS to exclude");
o->longDesc = N_("Window classes which should not be negated");
@@ -698,6 +716,11 @@ NEGSetScreenOption(CompScreen * screen, char *name, CompOptionValue * value)
switch (index)
{
+ case NEG_SCREEN_OPTION_EXCLUDE_NULL_WM_CLASS:
+ if (compSetBoolOption(o, value))
+ return TRUE;
+ break;
+
case NEG_SCREEN_OPTION_EXCLUDE_WINDOW_TYPE:
if (compSetOptionList(o, value))
{