The corresponding command is 'rename workspace to <name>'. As a side-effect
this fixes the command 'rename workspace 1 to to'.
Signed-off-by: Michael Walle <michael@walle.cc>
Focusing child from a workspace should now skip over the floating con and
go directly to its child. Focusing parent from that grandchild should leave
the workspace focused again.
As the workspace might be reached via recursion (e.g. moving from the edge
of a fullscreen split container), it's necessary to check for a fullscreen
container whenever a workspace is reached.
If a window with _NET_STARTUP_ID set is moved to another workspace, it
will delete any associated startup sequence immediately. This will also
occur if a window has a leader with _NET_STARTUP_ID set, if the leader
has no container (never been mapped).
A startup sequence may also be deleted if it's matched by
startup_workspace_for_window() and its 30-second timeout has elapsed.
This avoids a case where a fullscreen container could be moved onto a
workspace that already had its own fullscreen container, leading to
two fullscreen containers on top of each other.
Fix a crash that occured when moving a window to the scratchpad that is
seemingly floating to the user, but actually a descendant of a floating
parent con (and itself non-floating). If that is the case, move the
floating parent container to scratchpad instead of the window.
fixes#740
Previously, when you had an urgent container in a stack on some
invisible workspace (say urxvt) and you switched to it, the urgency hint
was not properly cleared.
A good visualization of the new algorithm is this:
+--------+
| |
+--------+=| S1 |========================
| | | |
| S0 | +--------+
| | +--------+
+--------+=========| |================
| S2 | +--------+
| | | |
+--------+ | S3 |
| |
+--------+
When focus is on S0, 'focus output right' will first match S1 (the
closest output which overlaps in the highlighted area), then S2, but not
S3 (since S3 does not overlap into the highlighted area).
fixes#669fixes#771
If there is a client with an urgency hint on another workspace and
switching to this workspace would cause the urgency to be reset (by
moving the focusing to the client), delay the reset by some time. This
gives the user the chance to see it.
This commit adds the possibility to configure the urgency delay timer
duration using the 'force_display_urgency_hint' directive. Also,
documentation and a testcase was added to allow for automated checks of
the intended behavior.
fixes#482
this implements both the "move container to workspace back_and_forth" command
and movements to the same workspace when auto_back_and_forth is set.
it includes documentation and test suite additions by michael.
it also simplifies the workspace_show_by_name function (making use of
workspace_get accepting NULL pointers).
Before commit 4976fa3350, setting the
layout of workspaces to something else than the default would just mess
up the parent container of the workspace (the content container).
After that commit, it would create an unnecessary split container when
you change the layout _before_ opening any containers. To avoid this, we
now store the layout (similar to how the 'workspace_layout'
configuration directive works) and apply it when the first container is
attached to the workspace.
Fixes#796
The problem was that scratchpad_move() didn’t check whether the source
workspace was focused. Therefore, 'move scratchpad' only worked reliably
interactively , but not when used with criteria.
When the workspace layout (formerly orientation) was forced to change
due to a move command, the split container we created was not marked as
split = true, which caused tree_flatten() to errnously kill the contents
of it and thus one window ended up unmanaged.
Also, the logic in tree_flatten() was inverted due to commit de94f6da.
fixes#790
Previously, in case 'layout stacked' (for example) had been called
interactively, con_set_layout would be called with focused->parent,
while with for_window, it’d be called on the actual matching container.
This difference in behavior was the cause for the inability to use
'for_window [class="XTerm"] layout tabbed', which now works \o/, but
more on that below.
The change also allows us to handle the case of the user selecting a
CT_WORKSPACE container properly, that is, by using the special case and
creating a new split container on the workspace which gets all the
contents, but a new layout.
Now, before you are enthusiastic about the change and try to use
for_window magic in your config file, keep in mind: The 'layout' command
acts on the parent split container. That is, when using a line such as
this one:
for_window [class="XTerm"] layout tabbed
…and opening an XTerm when on a workspace with one single other window,
the whole workspace will be set tabbed (just as previously when you
opened an XTerm and sent 'layout tabbed' manually).
Therefore, to open XTerm in its own tabbed split container, you need to
split before:
for_window [class="XTerm"] split v, layout tabbed
The comma here is important! It says that the second command should not
be treated as an entirely unrelated command, but it should also relate
the matching window (while it does work with a ';', that is prone to
race-conditions and should be avoided).
fixes#358
When resizing floating windows, changing the height was not correctly
handled. This commit fixes that and adds testcases for shrinking and
growing the width and height of floating windows.
From the source:
When starting i3 initially (and after each change to the connected
outputs), this function fixes the resolution of the __i3
pseudo-output. When that resolution is not set to a function which
shares a common divisor with every active output’s resolution,
floating point calculation errors will lead to the scratchpad window
moving when shown repeatedly.
fixes#632
This is useful for third-party scripts which require certain features
and want to error out cleanly when they are run with an old i3 version.
Additionally, i3 --version might be different from what’s actually
running (an old version of the binary), so i3-msg -t get_version will be
the best way to figure out the i3 version you are actually running from
this commit on.
With this commit, the "default" layout is replaced by the splith and
splitv layouts. splith is equivalent to default with orientation
horizontal and splitv is equivalent to default with orientation
vertical.
The "split h" and "split v" commands continue to work as before, they
split the current container and you will end up in a split container
with layout splith (after "split h") or splitv (after "split v").
To change a splith container into a splitv container, use either "layout
splitv" or "layout toggle split". The latter command is used in the
default config as mod+l (previously "layout default"). In case you have
"layout default" in your config file, it is recommended to just replace
it by "layout toggle split", which will work as "layout default" did
before when pressing it once, but toggle between horizontal/vertical
when pressing it repeatedly.
The rationale behind this commit is that it’s cleaner to have all
parameters that influence how windows are rendered in the layout itself
rather than having a special parameter in combination with only one
layout. This enables us to change existing split containers in all cases
without breaking existing features (see ticket #464). Also, users should
feel more confident about whether they are actually splitting or just
changing an existing split container now.
As a nice side-effect, this commit brings back the "layout toggle"
feature we once had in i3 version 3 (see the userguide).
AFAIK, it is safe to use in-place restart to upgrade into versions
after this commit (switching to an older version will break your layout,
though).
Fixes#464
e.g. pressing Mod1+x when having the following in your configfile:
bindsym Mod1+x some invalid command
will lead to an i3-nagbar instance popping up, offering you to view the
error log (which will contain parser errors from this commit on).
In certain situations (when you have a h-split within a h-split) you
couldn’t properly resize previously. This commit makes the resize
command properly traverse up the containers.
fixes#754
While it’s generally intended that wait_for_window is not called within
this testcase, in the first test instruction it was a mistake. The
window in fact gets mapped and therefore we should call wait_for_window.
…by using the new syntax which will not trigger i3-nagbar. Checking for
i3-nagbar is inherently prone to race conditions since i3-nagbar does
not communicate in any way that it’s there.
…by getting the socket path from i3 and then checking that it conforms
to what we expect. Previously we monitored /tmp, which can go wrong in
various ways, especially since i3’s directory within /tmp is not
predictable (by design).
This is now restricted according to the already defined fullscreen
focus constraints. Test case 157 was removed, as we don't prevent
level up/down in fullscreen anymore. Those commands are properly
tested in fullscreen by test case 156.
Fixes: #612
Basically, a focus change can't escape a fullscreen container. The
only exception is per-output fullscreen containers, as you should
be able to focus a container in a different workspace in this case.
This is an improvement on 4eab046e, now considering the difference
between global and per-output fullscreen and taking the tree
structure into account to determine what escaping the fullscreen
container means. It only affects targeted focus commands in the
form "for_window [...] focus", but it lays the foundation for
forthcoming fixes to all other focus commands.
If the target is in a different workspace, there's no reason why
we wouldn't allow the user to focus it. We already allow this when
focusing a workspace, for example.
Initially I thought using the second precision time() function is good enough,
but to make t/113-urgent.t considerably faster (>2s vs. 0.08s), we put in a
little more effort and use gettimeofday. Otherwise, this test blocks the whole
testsuite from completing much faster on modern machines :).
This behavior can be avoided by passing dont_create_temp_dir => 1 to
launch_with_config (or activate_i3).
This commit fixes t/159-socketpaths.t being flaky on non-systemd computers.
This re-introduces borders around the workspace buttons in i3bar.
No additional pixels will be consumed (you will not lose any space for your
windows).
On the rationale of using a custom parser instead of a lex/yacc one, see this
quote from src/commands_parser.c:
We use a hand-written parser instead of lex/yacc because our commands are
easy for humans, not for computers. Thus, it’s quite hard to specify a
context-free grammar for the commands. A PEG grammar would be easier, but
there’s downsides to every PEG parser generator I have come accross so far.
This parser is basically a state machine which looks for literals or strings
and can push either on a stack. After identifying a literal or string, it
will either transition to the current state, to a different state, or call a
function (like cmd_move()).
Special care has been taken that error messages are useful and the code is
well testable (when compiled with -DTEST_PARSER it will output to stdout
instead of actually calling any function).
During the migration phase (I plan to completely switch to this parser before
4.2 will be released), the new parser will parse every command you send to
i3 and save the resulting call stack. Then, the old parser will parse your
input and actually execute the commands. Afterwards, both call stacks will be
compared and any differences will be logged.
The new parser works with 100% of the test suite and produces identical call
stacks.
Using 'open' will not create an X11 window (while open_window does), so we will
get spurious motion notify events when switching focus, leading to endless loops.
With this commit, i3 will now use either $XDG_RUNTIME_DIR/i3 (XDG_RUNTIME_DIR
is only writable by the user, so this is not a problem) or a secure temporary
location in /tmp, following the pattern /tmp/i3-<user>.XXXXXX
eval 'package foo; use strict;' enables strict within eval, it does
not leak into the surrounding scope.
Also fix various warnings/compile errors found due to now enabled
strict and warnings.
Previously, we'd only close an empty workspace when we moved away
from it. Now we also close it when the last client exits, as long
as that workspace is not visible anymore.
We also don’t bother with timeouts anymore. It’s expected to run the tests with
a sufficiently recent version of i3. The tests will just hang if it doesn’t
work.
open_window has a better API than open_standard_window. It uses named
parameters and supplies default values for everything you don’t specify. This
way, you can use every feature which X11::XCB::Window supports.
Run ./i3-migrate-config-to-v4.pl < ~/.i3/config > /tmp/i3.config
and see if /tmp/i3.config is fine (especially check the comments
starting with XXX, they are inserted by the script).
Think of the following layout:
-------------
| tab | |
| con | win |
| | |
-------------
The tabbed container on the left has two children. Assume you have focused the
second/right child in the tabbed container. i3 used to focus the first/left
container of the tabbed container when using 'focus right' (it wrapped focus).
With this commit, the default behaviour is to instead focus the window on the
right of the screen.
The intention is to make focus switching more intuitive, especially with tabbed
containers supporting 'focus left'/'focus right' in tree. You should end up
using less 'focus parent' :).
You can force the old behaviour with 'force_focus_wrapping true' in your
config.
Code coverage is 62.5% with this commit.
New containers were previously attached directly to the workspace instead of to
the previously focused place in the workspace (for example a stacked con).
Fixes: #376
Use 'kill window' to kill a specific window (for example only one specific
popup), use 'kill client' to kill the whole application (or X11 connection to
be specific).