Ingo Bürk [Thu, 8 Oct 2015 10:16:25 +0000 (12:16 +0200)]
When drawing text, mark the surface as dirty.
Since libi3 currently creates its own cairo surface for drawing text, we
need to mark our own surface as dirty to force cairo to invalidate its
cache. Otherwise, this will result in graphical glitches such as the text
not showing up at all.
This wrapper can be removed in the future when libi3 is adapted to reuse
the same cairo surface as we do for all other drawing operations.
Ingo Bürk [Wed, 7 Oct 2015 09:03:18 +0000 (11:03 +0200)]
Allow text drawing to use the alpha channel.
We pass alpha channel information to the current text drawing code
and use it if it is available. The previous behavior of using full
opacity for RGB format colors is preserved.
Ingo Bürk [Mon, 5 Oct 2015 10:58:05 +0000 (12:58 +0200)]
Use 32-bit visuals for i3bar when possible and allow RGBA colors.
This patch creates all necessary windows for i3bar with 32-bit visuals if available.
It also introduces the possibility to define RGBA colors (next to RGB colors), which
allows the user to set the opacity of any color. This requires running a compositor.
With this patch we also start supporting _NET_SYSTEM_TRAY_VISUAL, which is necessary
for the tray icons so they create the tray window with the correct depth and visual.
Check duplicated bindings after translating keysym
1). See the issue #1926. For example, the second keybinding is not detected as a duplicate:
bindcode Mod4+24 sticky toggle
bindsym Mod4+q focus parent
2). To fix it, check duplicated bindings when translating the keysym to keycodes.
Break list of all commands into one line per command. This reduces the chances of merge conflicts when
introducing or removing commands and therefore increases maintainability (albeit by only a little).
When appending a layout containing a marked container, make sure that any other containers with the same mark
are unmarked during insertion of the new container.
Nils Schneider [Mon, 21 Sep 2015 12:27:22 +0000 (14:27 +0200)]
log: avoid buffer overflow in vlog
`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.
Nils Schneider [Mon, 21 Sep 2015 09:44:39 +0000 (11:44 +0200)]
Don't create empty workspaces on restart
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.
If no output is available, use the root screen geometry to determine the maximum size when checking the size of floating windows.
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.
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.
Nils Schneider [Mon, 14 Sep 2015 20:12:47 +0000 (22:12 +0200)]
randr: use root window in case of no randr outputs
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.
Set and unset individual atoms in _NET_WM_STATE instead of overwriting the entire list everytime. This allows independent management of multiple states.
Use the focused container to determine the target window_mode when using floating mode_toggle.
This fixes mode_toggle in case the workspace is focused and only a floating sticky window is open.
Ingo Bürk [Wed, 26 Aug 2015 19:06:53 +0000 (21:06 +0200)]
Make sure sticky windows pop to the front if they get sticky while not being on a visible workspace.
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.
Ingo Bürk [Sun, 23 Aug 2015 11:36:12 +0000 (13:36 +0200)]
Handle _NET_WM_STATE_STICKY, but only for floating containers. If this atom is set, the floating window will always be automatically moved to the currently active workspace of the output that it is on. This is the equivalent of a sticky note stuck to the monitor.
We will respect this atom upon managing a window as well as when we receive a request that changes the sticky state.
Use the EWMH support window rather than the root window as an input focus fallback.
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.
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 e71c304444dd3070877887d2bb5407cd64033946, 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.