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.
With commit c738b2e454bb8b096dd99d44e9e51030f8355b90 we changed i3 so
that the default keybindings can be used when ISO_Next_Group is enabled,
but bindings which explicitly use Mode_switch have precedence. This
behavior required the use of bindcode instead of bindsym.
With this commit, when switching from group 1 to group 2 using
ISO_Next_Group, i3 will re-translate all keybindings (looking at column
2/3, regardless of whether the keybinding itself specifies Mode_switch)
and re-grab them.
That way, the keybinding “bindsym $mod+x nop foo” will work when
pressing $mod+x without Mode_switch and when pressing the corresponding
$mod+x (different key) with Mode_switch. A binding such as “bindsym
Mode_switch+$mod+x nop bar” will still have precedence.
The intention here is to make bindsym keybindings work well with dual
keyboard layouts (such as {dvorak, us} or {us, ru}), so that users can
switch between groups and still have their (logical) keybindings behave
the same way.
Theo Buehler [Sat, 23 May 2015 11:12:18 +0000 (13:12 +0200)]
mkdirp: do not throw an error if directory exists
If I restart i3 4.10.2 twice, e.g. with
$ i3-msg restart; sleep 3; i3-msg restart
the second time I get the following two errors:
05/22/15 10:46:03 - ERROR: mkdir(/tmp/i3-theo.toAK7N) failed: File exists
05/22/15 10:46:03 - ERROR: Could not create "/tmp/i3-theo.toAK7N" for storing the restart layout, layout will be lost.
The first one is from mkdirp() in src/ipc.c and the second one is from
store_restart_layout() in src/util.c.
Notice that I do _not_ get the ``open()'' or ``Could not write restart layout to
...'' error messages, so the layout writing code after line 260 in
store_restart_layout() succeeded and the layout isn't actually lost. Thus,
these error messages are a bit misleading, especially the second one (which is
triggered by the failure of mkdirp()).
POSIX says about `mkdir -p':
``Each dir operand that names an existing directory shall be ignored without
error.''
Therefore, I suggest the following simple patch that makes mkdirp() succeed if
the named file exists and actually is a directory. This silences the second
error as well.
Deiz [Sun, 26 Apr 2015 18:23:08 +0000 (14:23 -0400)]
Initialize workspace rect to the output's upon creation
The comment immediately following implied that this was the intended
behaviour. Not doing so means that compound commands that both move a
window to a new workspace as well as do something that depends on the
workspace's geometry (e.g. 'move position center' or 'floating enable'
on a tiled window) would use the workspace's calloc'd 0x0+0x0 geometry.
Tony Crisci [Sun, 26 Apr 2015 02:43:46 +0000 (22:43 -0400)]
Ignore InputHint when not in WM_HINTS
When InputHint is not in WM_HINTS (i.e., the flag is not set), treat the window
as if the InputHint was set (the default behavior). This means that i3 will
focus the window when it becomes managed.
Tony Crisci [Sun, 26 Apr 2015 00:05:55 +0000 (20:05 -0400)]
Bugfix: serialize con_id with %p in run_binding()
%p is equivalent to either %x or %lx, depending on the pointer size of the
platform. Before this commit, we always used %d, which has the same behavior
on Linux, but is not automatically expanded to %ld on e.g. FreeBSD.
Tim Creech [Tue, 28 Jul 2015 00:47:12 +0000 (20:47 -0400)]
Changes for compiling on Illumos
* common.mk: use -lsocket -liconv -lgen on Illumos/Solaris
* mkdirp: return int and accept a mode argument
* use i3's mkdirp on everything except Illumos
1. Allow to use the line continuation, which is indicated by \ before the new line character, in config files.
2. Add a new testcase "247-config-line-continuation.t" for
a). testing line continuation
b). making sure string escaping still works
c). testing line continuations within a string
b). testing line continuations with too many lines
Remove asserts and return non-match instead if the container or its workspace cannot be found.
This can cause an issue if used in combination with for_window and i3bar during startup of i3 otherwise.
Ingo Bürk [Mon, 29 Jun 2015 21:58:48 +0000 (23:58 +0200)]
Implement new criterion 'workspace'.
If the match expression is a plain number (e.g., '99'), the number of a workspace will be compared strictly. Otherwise, the match expression is taken as a regular expression and compared against the workspace's name.
This allows all of the following:
hwangcc23 [Thu, 25 Jun 2015 14:33:50 +0000 (22:33 +0800)]
Fix TODO by replacing atoi by strtol
Fix TODO in bindings.c.
There is no problem to use atoi here since either keycode 0 or button0 is invalid.
But strtol is more flexible and is recommanded for conversion.
Ingo Bürk [Wed, 10 Jun 2015 17:01:05 +0000 (19:01 +0200)]
Parse the title_format and display the customized window title if a format was set.
The format string set with "title_format" can contain the placeholder "%title" which will be replaced with the actual window title.
By not overwriting window->name itself, we make sure that assignment matching still works as expected.
Ingo Bürk [Sat, 13 Jun 2015 12:58:41 +0000 (14:58 +0200)]
Read 'bindsym' rather than the old 'wheel_up_cmd' and 'wheel_down_cmd' directives in i3bar and call the command if specified.
The old directives are still read for transitional support which can be removed in a future version.