]> git.sur5r.net Git - i3/i3/commitdiff
config: accept “smart” as popup_during_fullscreen parameter (Thanks supplantr)
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 24 Feb 2013 16:23:37 +0000 (17:23 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 24 Feb 2013 16:23:37 +0000 (17:23 +0100)
This was the default, so explicitly setting it is not really necessary,
but of course it should be possible.

fixes #967

parser-specs/config.spec
src/config_directives.c
testcases/t/201-config-parser.t

index 9a4bf559c84116665fa6dd9ea08b9529e02b8a97..6960510d4d386a731b92a3a997befeaf74f9c44c 100644 (file)
@@ -229,7 +229,7 @@ state RESTART_STATE:
 
 # popup_during_fullscreen
 state POPUP_DURING_FULLSCREEN:
-  value = 'ignore', 'leave_fullscreen'
+  value = 'ignore', 'leave_fullscreen', 'smart'
       -> call cfg_popup_during_fullscreen($value)
 
 # client.background <hexcolor>
index 0a83d46febefd48644964c4b4086c23db1d4207c..a7fa3500526e356321edde1db5429658e1756a6d 100644 (file)
@@ -392,8 +392,13 @@ CFGFUN(restart_state, const char *path) {
 }
 
 CFGFUN(popup_during_fullscreen, const char *value) {
-    config.popup_during_fullscreen =
-        (strcmp(value, "ignore") == 0 ? PDF_IGNORE : PDF_LEAVE_FULLSCREEN);
+    if (strcmp(value, "ignore") == 0) {
+        config.popup_during_fullscreen = PDF_IGNORE;
+    } else if (strcmp(value, "leave_fullscreen") == 0) {
+        config.popup_during_fullscreen = PDF_LEAVE_FULLSCREEN;
+    } else {
+        config.popup_during_fullscreen = PDF_SMART;
+    }
 }
 
 CFGFUN(color_single, const char *colorclass, const char *color) {
index 182d7754bc7f3d805f4a342a5238679089e98595..6a49ff7844eddebfda36bec143ac450e8a83bec4 100644 (file)
@@ -144,6 +144,27 @@ is(parser_calls($config),
    $expected,
    'floating_minimum_size ok');
 
+################################################################################
+# popup_during_fullscreen
+################################################################################
+
+$config = <<'EOT';
+popup_during_fullscreen ignore
+popup_during_fullscreen leave_fullscreen
+popup_during_fullscreen SMArt
+EOT
+
+$expected = <<'EOT';
+cfg_popup_during_fullscreen(ignore)
+cfg_popup_during_fullscreen(leave_fullscreen)
+cfg_popup_during_fullscreen(smart)
+EOT
+
+is(parser_calls($config),
+   $expected,
+   'popup_during_fullscreen ok');
+
+
 ################################################################################
 # floating_modifier
 ################################################################################