Add fullscreen condition to If action
authorMikael Magnusson <mikachu@gmail.com>
Sat, 1 Oct 2016 11:47:26 +0000 (13:47 +0200)
committerMikael Magnusson <mikachu@gmail.com>
Sat, 1 Oct 2016 11:47:26 +0000 (13:47 +0200)
openbox/actions/if.c

index cceb29b..ff226e6 100644 (file)
@@ -58,6 +58,8 @@ typedef struct {
     gboolean maxfull_off;
     gboolean iconic_on;
     gboolean iconic_off;
+    gboolean fullscreen_on;
+    gboolean fullscreen_off;
     gboolean locked_on;
     gboolean locked_off;
     gboolean focused;
@@ -184,6 +186,7 @@ static void setup_query(Options* o, xmlNodePtr node, QueryTarget target) {
     set_bool(node, "maximizedhorizontal", &q->maxhorz_on, &q->maxhorz_off);
     set_bool(node, "maximizedvertical", &q->maxvert_on, &q->maxvert_off);
     set_bool(node, "iconified", &q->iconic_on, &q->iconic_off);
+    set_bool(node, "fullscreen", &q->fullscreen_on, &q->fullscreen_off);
     set_bool(node, "locked", &q->locked_on, &q->locked_off);
     set_bool(node, "focused", &q->focused, &q->unfocused);
     set_bool(node, "urgent", &q->urgent_on, &q->urgent_off);
@@ -349,6 +352,11 @@ static gboolean run_func_if(ObActionsData *data, gpointer options)
         if (q->iconic_off)
             is_true &= !query_target->iconic;
 
+        if (q->fullscreen_on)
+            is_true &= query_target->fullscreen;
+        if (q->fullscreen_off)
+            is_true &= !query_target->fullscreen;
+
         if (q->locked_on)
             is_true &= query_target->locked;
         if (q->locked_off)