I had a dilemma about the behaviour here:
1. Prohibit focus leaving the workspace in any case unless if
get_tree_next's initial argument is a workspace. This is what this
commit does (also i3-cycle).
2. Leave the workspace if no warp is possible (eg workspace with single
container or `focus right` with `V[a b c*]`).
Fixes#2180
- Makes `tree_next` not recursive.
- Adds `focus next|prev [sibling]` command. See (1.) and (2.) in
https://github.com/i3/i3/issues/2587#issuecomment-378505551 (Issue also
requests move command, not implemented here).
- Directional focus command now supports command criteria.
Wrapping is not implemented inside a floating container. This was also
true before the refactor so I am not changing it here.
This has changed after #3787.
The packed attribute was added in
75aac5bc02 for _NET_WORKAREA. However,
eec80838ab removed _NET_WORKAREA support.
I did some quick greping for `memcpy.+Rect` and didn't find any similar
code that could theoretically lead to problems.
This commit should fix "move con to parent" trick (see below) in the
case when con->parent->parent is a workspace.
The trick:
mark _a, focus parent, focus parent, mark _b,
[con_mark=_a] move window to mark _b, [con_mark=_a] focus
The trick got broken in commit 626af81232
in order to fix an i3 crash (#2003). Reverting said commit fixes the
trick. The crash is caused by the fact that empty workspace isn't
considered a split (checked in src/con.c:1324), so the moved window ends
up as a sibling of the target workspace, not as its child.
Move drag_pointer() and related definitions from floating.c to new file
drag_pointer.c since it's applicable not only to floating windows but
also to resizing of tiled windows.
Some apps including XTerm start with a WM_CLIENT_LEADER property
containing their own window ID. Before this commit, i3 tried to center
such windows onto itself and did it wrong since
`leader->rect == {0,0,0,0}` at this moment.
The first affected commit is 128122e766,
however, before it such windows already was misplaced, but got sanitized
afterward [1].
[1]: 8a3ef3a81b/src/floating.c (L329-L335)Fixes#3606
Fixes#3785 -- the issue where the Travis build failed because of gcc's
-Werror=address-of-packed-member.
Adds an equality function to avoid relying on memcmp().
This is strictly better: if the configured name does not match the current name,
the correct workspace will still be used.
When creating a new workspace, the configured name is still used.