CONFIG BREAK: rename 'mode floating/tiling' to 'floating enable/disable'
The three different variants now: floating enable floating disable floating toggle
This commit is contained in:
parent
9bbb37bb55
commit
bd49c80d5f
|
@ -611,8 +611,8 @@ focus_follows_mouse no
|
||||||
To change the layout of the current container to stacking, use +layout
|
To change the layout of the current container to stacking, use +layout
|
||||||
stacking+, for default use +layout default+ and for tabbed, use +layout
|
stacking+, for default use +layout default+ and for tabbed, use +layout
|
||||||
tabbed+. To make the current client (!) fullscreen, use +fullscreen+, to make
|
tabbed+. To make the current client (!) fullscreen, use +fullscreen+, to make
|
||||||
it floating (or tiling again) use +mode floating+ respectively +mode tiling+
|
it floating (or tiling again) use +floating enable+ respectively +floating disable+
|
||||||
(or +mode toggle+):
|
(or +floating toggle+):
|
||||||
|
|
||||||
*Examples*:
|
*Examples*:
|
||||||
--------------
|
--------------
|
||||||
|
@ -624,7 +624,7 @@ bindsym Mod1+w layout tabbed
|
||||||
bindsym Mod1+f fullscreen
|
bindsym Mod1+f fullscreen
|
||||||
|
|
||||||
# Toggle floating/tiling
|
# Toggle floating/tiling
|
||||||
bindsym Mod1+t mode toggle
|
bindsym Mod1+t floating toggle
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
=== Focusing/Moving containers
|
=== Focusing/Moving containers
|
||||||
|
|
|
@ -38,7 +38,7 @@ bindsym Mod1+w layout tabbed
|
||||||
bindsym Mod1+l layout default
|
bindsym Mod1+l layout default
|
||||||
|
|
||||||
# toggle tiling / floating
|
# toggle tiling / floating
|
||||||
bindsym Mod1+Shift+space mode toggle
|
bindsym Mod1+Shift+space floating toggle
|
||||||
|
|
||||||
# focus the parent container
|
# focus the parent container
|
||||||
bindsym Mod1+u focus parent
|
bindsym Mod1+u focus parent
|
||||||
|
|
|
@ -140,6 +140,13 @@ nop { WS_STRING; return TOK_NOP; }
|
||||||
restore { WS_STRING; return TOK_RESTORE; }
|
restore { WS_STRING; return TOK_RESTORE; }
|
||||||
mark { WS_STRING; return TOK_MARK; }
|
mark { WS_STRING; return TOK_MARK; }
|
||||||
|
|
||||||
|
enable { return TOK_ENABLE; }
|
||||||
|
true { return TOK_ENABLE; }
|
||||||
|
yes { return TOK_ENABLE; }
|
||||||
|
disable { return TOK_DISABLE; }
|
||||||
|
false { return TOK_DISABLE; }
|
||||||
|
no { return TOK_DISABLE; }
|
||||||
|
|
||||||
class { BEGIN(WANT_QSTRING); return TOK_CLASS; }
|
class { BEGIN(WANT_QSTRING); return TOK_CLASS; }
|
||||||
id { BEGIN(WANT_QSTRING); return TOK_ID; }
|
id { BEGIN(WANT_QSTRING); return TOK_ID; }
|
||||||
con_id { BEGIN(WANT_QSTRING); return TOK_CON_ID; }
|
con_id { BEGIN(WANT_QSTRING); return TOK_CON_ID; }
|
||||||
|
|
|
@ -135,6 +135,8 @@ char *parse_cmd(const char *new) {
|
||||||
%token TOK_MODE "mode"
|
%token TOK_MODE "mode"
|
||||||
%token TOK_TILING "tiling"
|
%token TOK_TILING "tiling"
|
||||||
%token TOK_FLOATING "floating"
|
%token TOK_FLOATING "floating"
|
||||||
|
%token TOK_ENABLE "enable"
|
||||||
|
%token TOK_DISABLE "disable"
|
||||||
%token TOK_WORKSPACE "workspace"
|
%token TOK_WORKSPACE "workspace"
|
||||||
%token TOK_TOGGLE "toggle"
|
%token TOK_TOGGLE "toggle"
|
||||||
%token TOK_FOCUS "focus"
|
%token TOK_FOCUS "focus"
|
||||||
|
@ -170,7 +172,7 @@ char *parse_cmd(const char *new) {
|
||||||
|
|
||||||
%type <number> direction
|
%type <number> direction
|
||||||
%type <number> level
|
%type <number> level
|
||||||
%type <number> window_mode
|
%type <number> boolean
|
||||||
%type <number> border_style
|
%type <number> border_style
|
||||||
%type <number> layout_mode
|
%type <number> layout_mode
|
||||||
%type <number> resize_px
|
%type <number> resize_px
|
||||||
|
@ -345,7 +347,7 @@ operation:
|
||||||
| open
|
| open
|
||||||
| fullscreen
|
| fullscreen
|
||||||
| split
|
| split
|
||||||
| mode
|
| floating
|
||||||
| mark
|
| mark
|
||||||
| resize
|
| resize
|
||||||
| nop
|
| nop
|
||||||
|
@ -541,8 +543,8 @@ direction:
|
||||||
| 'v' { $$ = 'v'; }
|
| 'v' { $$ = 'v'; }
|
||||||
;
|
;
|
||||||
|
|
||||||
mode:
|
floating:
|
||||||
TOK_MODE window_mode
|
TOK_FLOATING boolean
|
||||||
{
|
{
|
||||||
HANDLE_EMPTY_MATCH;
|
HANDLE_EMPTY_MATCH;
|
||||||
|
|
||||||
|
@ -554,7 +556,7 @@ mode:
|
||||||
toggle_floating_mode(current->con, false);
|
toggle_floating_mode(current->con, false);
|
||||||
} else {
|
} else {
|
||||||
printf("should switch mode to %s\n", ($2 == TOK_FLOATING ? "floating" : "tiling"));
|
printf("should switch mode to %s\n", ($2 == TOK_FLOATING ? "floating" : "tiling"));
|
||||||
if ($2 == TOK_FLOATING) {
|
if ($2 == TOK_ENABLE) {
|
||||||
floating_enable(current->con, false);
|
floating_enable(current->con, false);
|
||||||
} else {
|
} else {
|
||||||
floating_disable(current->con, false);
|
floating_disable(current->con, false);
|
||||||
|
@ -566,9 +568,9 @@ mode:
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
window_mode:
|
boolean:
|
||||||
TOK_FLOATING { $$ = TOK_FLOATING; }
|
TOK_ENABLE { $$ = TOK_ENABLE; }
|
||||||
| TOK_TILING { $$ = TOK_TILING; }
|
| TOK_DISABLE { $$ = TOK_DISABLE; }
|
||||||
| TOK_TOGGLE { $$ = TOK_TOGGLE; }
|
| TOK_TOGGLE { $$ = TOK_TOGGLE; }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ $tmp2 = get_unused_workspace();
|
||||||
cmd "workspace $tmp";
|
cmd "workspace $tmp";
|
||||||
|
|
||||||
cmd "open";
|
cmd "open";
|
||||||
cmd "mode toggle";
|
cmd "floating toggle";
|
||||||
|
|
||||||
my $ws = get_ws($tmp);
|
my $ws = get_ws($tmp);
|
||||||
is(@{$ws->{nodes}}, 0, 'no nodes on workspace');
|
is(@{$ws->{nodes}}, 0, 'no nodes on workspace');
|
||||||
|
|
|
@ -54,10 +54,10 @@ is(@{$nodes->[1]->{nodes}}, 2, 'two windows in split con');
|
||||||
# 2: make it tiling, see where it ends up
|
# 2: make it tiling, see where it ends up
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
cmd 'mode toggle';
|
cmd 'floating toggle';
|
||||||
|
|
||||||
my ($nodes, $focus) = get_ws_content($tmp);
|
my ($nodes, $focus) = get_ws_content($tmp);
|
||||||
|
|
||||||
is(@{$nodes->[1]->{nodes}}, 3, 'three windows in split con after mode toggle');
|
is(@{$nodes->[1]->{nodes}}, 3, 'three windows in split con after floating toggle');
|
||||||
|
|
||||||
done_testing;
|
done_testing;
|
||||||
|
|
|
@ -29,7 +29,7 @@ ok($window->mapped, 'Window is mapped');
|
||||||
cmp_ok($absolute->{width}, '>', 400, 'i3 raised the width');
|
cmp_ok($absolute->{width}, '>', 400, 'i3 raised the width');
|
||||||
cmp_ok($absolute->{height}, '>', 150, 'i3 raised the height');
|
cmp_ok($absolute->{height}, '>', 150, 'i3 raised the height');
|
||||||
|
|
||||||
cmd 'mode toggle';
|
cmd 'floating toggle';
|
||||||
sleep 0.25;
|
sleep 0.25;
|
||||||
|
|
||||||
($absolute, $top) = $window->rect;
|
($absolute, $top) = $window->rect;
|
||||||
|
|
|
@ -49,7 +49,7 @@ sleep 0.25;
|
||||||
#####################################################################
|
#####################################################################
|
||||||
cmd 'nop setting floating';
|
cmd 'nop setting floating';
|
||||||
cmd 'focus parent';
|
cmd 'focus parent';
|
||||||
cmd 'mode floating';
|
cmd 'floating enable';
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
# Get geometry of the first floating node (the split container)
|
# Get geometry of the first floating node (the split container)
|
||||||
|
|
Loading…
Reference in New Issue