tests: Use AnyEvent::I3’s get_marks (requires AE::I3 >=0.08)
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.
Introduce the i3-sensible-{pager,editor,terminal} scripts
The former two provide fallbacks in case $PAGER or $EDITOR is not set (which
might be more common than you think, because they have to be set in
~/.xsession, not in the shell configuration!) while the latter tries to launch
a terminal emulator. The scripts are most prominently used in i3-nagbar, which
alerts the user when the configuration is broken for some reason. Also,
i3-sensible-terminal is used in the default configuration.
This commit does not rely on the shell supporting ${PAGER:-less} anymore, which
is not the case for 'fish'.
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.
tests: complete_run: directly use X11::XCB instead of ::Connection
This saves about 0.5s wallclock time due to not starting up Moose/Mouse.
This is worthwhile when you develop a new feature and you are often invoking
complete_run for one specific test.
This is mainly useful for the testsuite. The tests can wait until i3 processed
all X11 events and then continue. This eliminates sleep() calls which leads to
a more robust and faster testsuite.
Michael Walle [Mon, 19 Sep 2011 20:43:25 +0000 (22:43 +0200)]
Add force_xinerama configuration option
The configuration option does the same as the commandline parameter, except
it can be easily set by the user (e.g. you are using KDM and can't start a
session through ~/.xsession).
i3bar: Bugfix: Check if the X11 connection is unavailable
This fixes the condition where the i3 socket for some reason did not produce an
error, but the X server exited (earlier than i3?) and the left-over i3bar
process would consume 100% CPU.
How to reproduce the problem:
1) Start ./testcases/Xdummy :8
2) Start DISPLAY=:8 i3bar -s <socket path to i3 on :0>
3) Kill the Xdummy
Bugfix: Avoid out of bounds coordinates when moving floating windows (Thanks eeemsi)
This commit makes the coordinates proportional when moving floating windows.
That is, if you have a window at the bottom of your 1920 px monitor and move it
to your 800 px monitor, it will be at the bottom of the 800 px monitor (and not
out of bounds).
This introduces the '-F format' parameter, which takes a format and replaces %s
in it with the user input. An example: The user should enter the target
workspace name. The appropriate i3-input invocation looks like this:
i3-input -F 'workspace "%s"' -P 'Switch to workspace: '
Bugfix: Don’t warp the pointer if it already is on the target output (Thanks cls, pnutzh4x0r)
My testcase was putting a floating window on the left output, but overlapping a
little to the right output. Then switch to a workspace on the right output.
Also make compilation possible on systems with libev 3
From the source:
We need ev >= 4 for the following code. Since it is not *that* important
(it only makes sure that there are no i3-nagbar instances left behind) we
still support old systems with libev 3.
Instead of using a quoted string to specify the class / title, the assign
command now uses criteria, just like the for_window command or the command
scopes.
An example comes here:
# Assign all Chromium windows (including popups) to workspace 1: www
assign [class="^Chromium$"] → 1: www
# Make the main browser window borderless
for_window [class="^Chromium$" title=" - Chromium$"] border none
This gives you more control over the matching process due to various reasons:
1) Criteria work case-sensitive by default. Use the (?i) option if you want a
case-insensitive match, like this:
assign [class="(?i)^ChroMIUM$"] → 1
2) class and instance of WM_CLASS can now be matched separately. For example,
when starting urxvt -name irssi, xprop will report this:
WM_CLASS(STRING) = "irssi", "URxvt"
The first part of this is the instance ("irssi"), the second part is the
class ("URxvt").
An appropriate assignment looks like this:
assign [class="^URxvt$" instance="irssi"] → 2
3) You can now freely use a forward slash (/) in all strings since that is no
longer used to separate class from title (in-band signaling is bad, mhkay?).