Extend tiling/floating criteria with optional auto/user values (#4006)

The default `tiling` and `floating` behavior is preserved and matches
both cases.

Adds a new handler to `remanage_window` on A_I3_FLOATING_WINDOW change.

Mainly in order to `run_assignments`, this makes `for_window [floating]`
directives to work for windows which where initially opened as tiling.
Now, when floating is enabled, `for_window` will trigger correctly. Same
applies to `for_window [tiling]`.

The obvious solution of `run_assignments` after
`floating_{enable,disable}` doesn't work because `run_assignments`
modifies the parser state in src/assignments.c:51.

Fixes #3588

Co-Authored-By: Michael Stapelberg <michael@stapelberg.de>
This commit is contained in:
Orestis Floros
2020-04-12 13:49:08 +02:00
committed by GitHub
parent e7191af8b3
commit ae757c6848
9 changed files with 216 additions and 26 deletions

View File

@ -1900,8 +1900,18 @@ con_id::
to match only the currently focused window.
floating::
Only matches floating windows. This criterion requires no value.
floating_from::
Like +floating+ but this criterion takes two possible values: "auto"
and "user". With "auto", only windows that were automatically opened as
floating are matched. With "user", only windows that the user made
floating are matched.
tiling::
Only matches tiling windows. This criterion requires no value.
tiling_from::
Like +tiling+ but this criterion takes two possible values: "auto" and
"user". With "auto", only windows that were automatically opened as
tiling are matched. With "user", only windows that the user made tiling
are matched.
The criteria +class+, +instance+, +role+, +title+, +workspace+ and +mark+ are
actually regular expressions (PCRE). See +pcresyntax(3)+ or +perldoc perlre+ for