`vlog()` can not handle log messages longer than 4096 bytes. However, the
message generated in `store_restart_layout()` is likely to exceed this
as it contains a long JSON string.
This has caused a few SEGFAULTS during restarts for me when running with
`-d all`.
Fix this by truncating the message to 4096 bytes and punching in a newline at
the end.
This fixes a bug I introduced in #1921. When restarting i3 in place a
stray workspace was created on the root_output during restart. On first
start, this workspace would have been moved to the first real and empty
output.
However, this does not produce the desired result during restarts when
workspaces are alread present on all real outputs. The stray workspace would
still be added to the first real output which already contains some
workspaces. Thus, adding a new empty workspace to it.
Fix this by delaying creation of the root output's workspace until it is
known whether the output is active or not.
Fixes#1940
This is necessary during a restart of i3 when restoring floating windows. In this situation, we restore the layout before setting up the RandR outputs which would set the window's size to 0, making it invisible.
Thanks to hwangcc23 and spudowiar for reporting.
fixes#1910fixes#1934
1. Reference: issue #1929
2. When restarting, add the argument "-d all" if debuglog is on.
3. Add add_argument() for adding/replacing the given argument.
This patch introduces a root output covering the root window. It is used
in two cases:
1. RandR is not available. In this case, the previous behaviour of
creating a single output covering the root window is preserved.
2. RandR is available, but there is no active output. In this case,
the root output is enabled and will be the only active output.
If any RandR output becomes available, the root output will be
disabled again. Existing mechanisms for migrating workspaces will
just work without modification.
I've carefully slipped in a global variable `Output root_output` representing
that output.
Fixes#926 and #1489
This commit also reworks the way focusing sticky windows is prevented by not focusing them temporarily at all, but preventing the focus in the first place.
If no other window is available on the active workspace, we now select the EWMH support window (used to indicate that an EWMH-compliant window manager is preent) as the focus window rather than the root window. The NET_WM_ACTIVE window will still be set to XCB_WINDOW_NONE to pretend that no window is actually focused.
This fixes the issue that when using the root window, a fallback mechanism in X11 takes effect which routes keyboard input to the window under the cursor, independent of whether that window has the input focus. Using the EWMH window instead, we can avoid this behavior. We cannot simply set it to XCB_WINDOW_NONE as this would discard all keyboard events, breaking keybindings.
fixes#1378
This reverts commit e71c304444.
It turns out that several users have workflows in which they turn off
their monitors without using e.g. `xrandr --output DP-1 --off`. The
result is that the monitors are disconnected, but not disabled.
With commit e71c304444, i3 started to see
these two states as one and the same state, but that causes more harm
than it does good. For example, for some users with only one monitor, i3
would just exit when these users turned off their monitor.
related to #1858, #1839fixes#1845