Ingo Bürk [Mon, 19 Oct 2015 16:31:21 +0000 (18:31 +0200)]
Introduce "--add" for marking windows.
In order to keep compatibility to before allowing multiple marks on a window,
we introduce a flag "--add" that must be set to put more than one mark on a
window. The default, which is also available as "--replace", keeps the old
behavior of overwriting a mark when setting a new one.
Ingo Bürk [Mon, 19 Oct 2015 16:10:20 +0000 (18:10 +0200)]
Allow multiple marks on windows.
This patch allows multiple marks to be set on a single window. The restriction that a mark may
only be on one window at a time is still upheld as this is necessary for commands like
"move window to mark" to make sense.
Adaephon-GH [Wed, 21 Oct 2015 11:58:45 +0000 (13:58 +0200)]
Make rendering of key bindings more consistent
- Render key names and key bindings verbatim if they could be used like
that in the configuration (no special format for "colloquial" names:
Alt, Windows, ...)
- Use only lower case letters for key bindings
Adaephon-GH [Wed, 21 Oct 2015 11:35:52 +0000 (13:35 +0200)]
Improve placement of explicit IDs for headings
In some cases the IDs of section titles was placed after the section
title. With that in the rendered HTML the ID was placed on the paragraph
and not on the heading. This led to heading not being shown when the
corresponding link was clicked.
Adaephon-GH [Mon, 19 Oct 2015 05:39:59 +0000 (07:39 +0200)]
Fix erroneous headline for moving to mark
The headline indicated that it would be possible to move containers and *workspaces* to marks but the following text clearly shows that it should state containers and *windows*.
hwangcc23 [Fri, 16 Oct 2015 15:17:41 +0000 (23:17 +0800)]
Revise workspace next/prev
See the issue #1798 (http://github.com/i3/i3/issues/1798).
+workspace_next+ as-is cycles through either numbered or named workspaces,
but when it reaches the last numbered/named workspace, it only looks for
named workspaces. This commit changes it: look for named workspaces after
exhausting numbered ones, but also for numbered ones after exhausting
named ones.
Also add a test case 528-workspace-next-prev.t (numbered workspaces and named
workspaces on 2 outputs) for testing this.
Ingo Bürk [Wed, 14 Oct 2015 18:49:52 +0000 (20:49 +0200)]
Introduce switch for the drawing backend
This commit restores the old XCB drawing code paths while keeping the
cairo drawing available via a compile-time switch (I3BAR_CAIRO). This
is necessary as cairo currently has a bug that breaks i3bar for users
without the RENDER extension, which might be the case, e.g., for VNC
users.
For more context, see #1989 and the discussions about its fix. Once the
cairo fix is available in a stable release, i3 can depend on that version
and remove the XCB drawing code paths.
Ingo Bürk [Wed, 14 Oct 2015 17:03:05 +0000 (19:03 +0200)]
Extract cairo_clear_surface.
This commit refactors the i3bar drawing code to also define an abstraction
function for clearing a surface. This is needed to fully abstract i3bar/xcb.c's
drawing code so that we can introduce a switch to easily exchange the
underlying drawing mechanism.
Ingo Bürk [Mon, 12 Oct 2015 21:43:47 +0000 (23:43 +0200)]
Make pango markup in mode names optional with a flag.
This introduces the flag "--pango" on the mode config directive to
explicitly enable pango markup for mode names. Not setting this will
cause the mode name to be rendered as is.
This fixes a regression in 4.11 where mode names containing characters
such as '<' would break user's configs as they didn't escape these
characters.
Ingo Bürk [Mon, 12 Oct 2015 10:56:19 +0000 (12:56 +0200)]
Suppress no_focus for first window on a workspace.
With this patch, the no_focus directive will be ignored if the
to-be-opened window is the first on its workspace as there's no
reason the user would not want to focus it in this case.
This improves usability when, for example, using a tabbed
workspace_layout.
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.