]> git.sur5r.net Git - i3/i3/commitdiff
Merge branch 'master' into next
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 31 Jan 2015 21:56:08 +0000 (22:56 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 31 Jan 2015 21:56:08 +0000 (22:56 +0100)
1  2 
parser-specs/config.spec
src/config_directives.c
testcases/t/201-config-parser.t

diff --combined parser-specs/config.spec
index 95c206fe4ae293166e2db6426f8f6c906f838348,7a93b9fb95e17d5af69cc1e91bdfa5b2f407bf71..dbdf83c2808aa076fce039a0a27313c8cb7c6953
@@@ -45,7 -45,7 +45,7 @@@ state INITIAL
    exectype = 'exec_always', 'exec'         -> EXEC
    colorclass = 'client.background'
        -> COLOR_SINGLE
-   colorclass = 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent'
+   colorclass = 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
        -> COLOR_BORDER
  
  # We ignore comments and 'set' lines (variables).
@@@ -278,8 -278,6 +278,8 @@@ state FONT
  state BINDING:
    release = '--release'
        ->
 +  whole_window = '--whole-window'
 +      ->
    modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control', 'Ctrl', 'Mode_switch', '$mod'
        ->
    '+'
  state BINDCOMMAND:
    release = '--release'
        ->
 +  whole_window = '--whole-window'
 +      ->
    command = string
 -      -> call cfg_binding($bindtype, $modifiers, $key, $release, $command)
 +      -> call cfg_binding($bindtype, $modifiers, $key, $release, $whole_window, $command)
  
  ################################################################################
  # Mode configuration
@@@ -337,10 -333,8 +337,10 @@@ state MODE_BINDING
  state MODE_BINDCOMMAND:
    release = '--release'
        ->
 +  whole_window = '--whole-window'
 +      ->
    command = string
 -      -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $command); MODE
 +      -> call cfg_mode_binding($bindtype, $modifiers, $key, $release, $whole_window, $command); MODE
  
  ################################################################################
  # Bar configuration (i3bar)
@@@ -364,8 -358,6 +364,8 @@@ state BAR
    'hidden_state'           -> BAR_HIDDEN_STATE
    'id'                     -> BAR_ID
    'modifier'               -> BAR_MODIFIER
 +  'wheel_up_cmd'           -> BAR_WHEEL_UP_CMD
 +  'wheel_down_cmd'         -> BAR_WHEEL_DOWN_CMD
    'position'               -> BAR_POSITION
    'output'                 -> BAR_OUTPUT
    'tray_output'            -> BAR_TRAY_OUTPUT
@@@ -411,14 -403,6 +411,14 @@@ state BAR_MODIFIER
    modifier = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Control', 'Ctrl', 'Shift'
        -> call cfg_bar_modifier($modifier); BAR
  
 +state BAR_WHEEL_UP_CMD:
 +  command = string
 +      -> call cfg_bar_wheel_up_cmd($command); BAR
 +
 +state BAR_WHEEL_DOWN_CMD:
 +  command = string
 +      -> call cfg_bar_wheel_down_cmd($command); BAR
 +
  state BAR_POSITION:
    position = 'top', 'bottom'
        -> call cfg_bar_position($position); BAR
@@@ -428,7 -412,7 +428,7 @@@ state BAR_OUTPUT
        -> call cfg_bar_output($output); BAR
  
  state BAR_TRAY_OUTPUT:
 -  output = string
 +  output = word
        -> call cfg_bar_tray_output($output); BAR
  
  state BAR_FONT:
diff --combined src/config_directives.c
index e8fdfe77ec5a68b40bbb3e505c60aeae055377e3,781d6b36d74b606e78e2d72f3930d4094043fd94..80d7876b927f573d080a52a5b5c1aa259d593a1a
@@@ -171,8 -171,8 +171,8 @@@ CFGFUN(font, const char *font) 
      font_pattern = sstrdup(font);
  }
  
 -CFGFUN(binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *command) {
 -    configure_binding(bindtype, modifiers, key, release, command, DEFAULT_BINDING_MODE);
 +CFGFUN(binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *whole_window, const char *command) {
 +    configure_binding(bindtype, modifiers, key, release, whole_window, command, DEFAULT_BINDING_MODE);
  }
  
  /*******************************************************************************
  
  static char *current_mode;
  
 -CFGFUN(mode_binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *command) {
 -    configure_binding(bindtype, modifiers, key, release, command, current_mode);
 +CFGFUN(mode_binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *whole_window, const char *command) {
 +    configure_binding(bindtype, modifiers, key, release, whole_window, command, current_mode);
  }
  
  CFGFUN(enter_mode, const char *modename) {
@@@ -271,15 -271,13 +271,15 @@@ CFGFUN(new_window, const char *windowty
      }
  
      if (strcmp(windowtype, "new_window") == 0) {
 -        DLOG("default tiled border style = %d and border width = %d\n", border_style, border_width);
 +        DLOG("default tiled border style = %d and border width = %d (%d physical px)\n",
 +             border_style, border_width, logical_px(border_width));
          config.default_border = border_style;
 -        config.default_border_width = border_width;
 +        config.default_border_width = logical_px(border_width);
      } else {
 -        DLOG("default floating border style = %d and border width = %d\n", border_style, border_width);
 +        DLOG("default floating border style = %d and border width = %d (%d physical px)\n",
 +             border_style, border_width, logical_px(border_width));
          config.default_floating_border = border_style;
 -        config.default_floating_border_width = border_width;
 +        config.default_floating_border_width = logical_px(border_width);
      }
  }
  
@@@ -336,7 -334,7 +336,7 @@@ CFGFUN(workspace, const char *workspace
       * outputs */
      struct Workspace_Assignment *assignment;
      bool duplicate = false;
 -    TAILQ_FOREACH (assignment, &ws_assignments, ws_assignments) {
 +    TAILQ_FOREACH(assignment, &ws_assignments, ws_assignments) {
          if (strcasecmp(assignment->name, workspace) == 0) {
              ELOG("You have a duplicate workspace assignment for workspace \"%s\"\n",
                   workspace);
@@@ -392,6 -390,7 +392,7 @@@ CFGFUN(color, const char *colorclass, c
      APPLY_COLORS(focused);
      APPLY_COLORS(unfocused);
      APPLY_COLORS(urgent);
+     APPLY_COLORS(placeholder);
  
  #undef APPLY_COLORS
  }
@@@ -461,16 -460,6 +462,16 @@@ CFGFUN(bar_modifier, const char *modifi
          current_bar.modifier = M_SHIFT;
  }
  
 +CFGFUN(bar_wheel_up_cmd, const char *command) {
 +    FREE(current_bar.wheel_up_cmd);
 +    current_bar.wheel_up_cmd = sstrdup(command);
 +}
 +
 +CFGFUN(bar_wheel_down_cmd, const char *command) {
 +    FREE(current_bar.wheel_down_cmd);
 +    current_bar.wheel_down_cmd = sstrdup(command);
 +}
 +
  CFGFUN(bar_position, const char *position) {
      current_bar.position = (strcmp(position, "top") == 0 ? P_TOP : P_BOTTOM);
  }
index 86ef731f58d69013223db30b420b4d483c7c4e51,51192f55f8076fb3d8e34fd24596b810bc6b0bcd..9643aa42f5f5678536a181e481cc1a1da00f1fdf
@@@ -50,9 -50,9 +50,9 @@@ EO
  
  my $expected = <<'EOT';
  cfg_enter_mode(meh)
 -cfg_mode_binding(bindsym, Mod1,Shift, x, (null), resize grow)
 -cfg_mode_binding(bindcode, Mod1, 44, (null), resize shrink)
 -cfg_mode_binding(bindsym, Mod1, x, --release, exec foo)
 +cfg_mode_binding(bindsym, Mod1,Shift, x, (null), (null), resize grow)
 +cfg_mode_binding(bindcode, Mod1, 44, (null), (null), resize shrink)
 +cfg_mode_binding(bindsym, Mod1, x, --release, (null), exec foo)
  EOT
  
  is(parser_calls($config),
@@@ -408,6 -408,7 +408,7 @@@ client.focused          #4c7899 #28557
  client.focused_inactive #333333 #5f676a #ffffff #484e50
  client.unfocused        #333333 #222222 #888888 #292d2e
  client.urgent           #2f343a #900000 #ffffff #900000
+ client.placeholder      #000000 #0c0c0c #ffffff #000000
  EOT
  
  $expected = <<'EOT';
@@@ -415,6 -416,7 +416,7 @@@ cfg_color(client.focused, #4c7899, #285
  cfg_color(client.focused_inactive, #333333, #5f676a, #ffffff, #484e50)
  cfg_color(client.unfocused, #333333, #222222, #888888, #292d2e)
  cfg_color(client.urgent, #2f343a, #900000, #ffffff, #900000)
+ cfg_color(client.placeholder, #000000, #0c0c0c, #ffffff, #000000)
  EOT
  
  is(parser_calls($config),
@@@ -431,7 -433,7 +433,7 @@@ client.focused          #4c7899 #28557
  EOT
  
  my $expected_all_tokens = <<'EOT';
- ERROR: CONFIG: Expected one of these tokens: <end>, '#', 'set', 'bindsym', 'bindcode', 'bind', 'bar', 'font', 'mode', 'floating_minimum_size', 'floating_maximum_size', 'floating_modifier', 'default_orientation', 'workspace_layout', 'new_window', 'new_float', 'hide_edge_borders', 'for_window', 'assign', 'focus_follows_mouse', 'mouse_warping', 'force_focus_wrapping', 'force_xinerama', 'force-xinerama', 'workspace_auto_back_and_forth', 'fake_outputs', 'fake-outputs', 'force_display_urgency_hint', 'workspace', 'ipc_socket', 'ipc-socket', 'restart_state', 'popup_during_fullscreen', 'exec_always', 'exec', 'client.background', 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent'
+ ERROR: CONFIG: Expected one of these tokens: <end>, '#', 'set', 'bindsym', 'bindcode', 'bind', 'bar', 'font', 'mode', 'floating_minimum_size', 'floating_maximum_size', 'floating_modifier', 'default_orientation', 'workspace_layout', 'new_window', 'new_float', 'hide_edge_borders', 'for_window', 'assign', 'focus_follows_mouse', 'mouse_warping', 'force_focus_wrapping', 'force_xinerama', 'force-xinerama', 'workspace_auto_back_and_forth', 'fake_outputs', 'fake-outputs', 'force_display_urgency_hint', 'workspace', 'ipc_socket', 'ipc-socket', 'restart_state', 'popup_during_fullscreen', 'exec_always', 'exec', 'client.background', 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
  EOT
  
  my $expected_end = <<'EOT';
@@@ -618,7 -620,7 +620,7 @@@ EO
  
  $expected = <<'EOT';
  cfg_enter_mode(yo)
 -cfg_mode_binding(bindsym, (null), x, (null), resize shrink left)
 +cfg_mode_binding(bindsym, (null), x, (null), (null), resize shrink left)
  ERROR: CONFIG: Expected one of these tokens: <end>, '#', 'set', 'bindsym', 'bindcode', 'bind', '}'
  ERROR: CONFIG: (in file <stdin>)
  ERROR: CONFIG: Line   1: mode "yo" {
@@@ -645,7 -647,7 +647,7 @@@ EO
  
  $expected = <<'EOT';
  cfg_bar_output(LVDS-1)
 -ERROR: CONFIG: Expected one of these tokens: <end>, '#', 'set', 'i3bar_command', 'status_command', 'socket_path', 'mode', 'hidden_state', 'id', 'modifier', 'position', 'output', 'tray_output', 'font', 'binding_mode_indicator', 'workspace_buttons', 'strip_workspace_numbers', 'verbose', 'colors', '}'
 +ERROR: CONFIG: Expected one of these tokens: <end>, '#', 'set', 'i3bar_command', 'status_command', 'socket_path', 'mode', 'hidden_state', 'id', 'modifier', 'wheel_up_cmd', 'wheel_down_cmd', 'position', 'output', 'tray_output', 'font', 'binding_mode_indicator', 'workspace_buttons', 'strip_workspace_numbers', 'verbose', 'colors', '}'
  ERROR: CONFIG: (in file <stdin>)
  ERROR: CONFIG: Line   1: bar {
  ERROR: CONFIG: Line   2:     output LVDS-1