Commit Graph

19 Commits (beb96ad18cfad44e54643af1af0f9900216e8b85)

Author SHA1 Message Date
Albert Safin beb96ad18c Move container to marked workspace: refine corner case
This commit should fix "move con to parent" trick (see below) in the
case when con->parent->parent is a workspace.

The trick:

    mark _a, focus parent, focus parent, mark _b,
    [con_mark=_a] move window to mark _b, [con_mark=_a] focus

The trick got broken in commit 626af81232
in order to fix an i3 crash (#2003).  Reverting said commit fixes the
trick.  The crash is caused by the fact that empty workspace isn't
considered a split (checked in src/con.c:1324), so the moved window ends
up as a sibling of the target workspace, not as its child.
2019-10-07 18:15:03 +00:00
Orestis Floros 90c08a52f0
Introduce cmp_tree test function
Related to #3503
2018-12-12 13:09:15 +02:00
Orestis Floros 1d5b43c18f
Move get_output_for_workspace() to i3test 2018-06-27 14:56:50 +03:00
Tony Crisci c42de09b1b Support _NET_WM_STATE_FOCUSED
_NET_WM_STATE_FOCUSED is set on _NET_WM_STATE to indicate that the
window is focused. It must be set when the window is newly focused and
removed once the window no longer has focus.

> _NET_WM_STATE_FOCUSED indicates whether the window's decorations are
> drawn in an active state. Clients MUST regard it as a read-only hint.
> It cannot be set at map time or changed via a _NET_WM_STATE client
> message.

For example, this is used by GTK applications to show the decoration in
an active or inactive state. This change can be tested by opening a GTK
application (like evince), focusing the window and unfocusing the
window, and observing a change in the window decorations.

Fixes #2273
2018-03-23 14:30:57 +02:00
Daniel Mueller 3e34122de4 Perform proper cleanup for signals with 'Term' action (#3057)
Issue #3049 describes a case where terminating i3 by means of SIGTERM
causes it to leak the runtime directory and all its contents. There are
multiple issues at play: first, any cleanup handlers registered via
atexit are never invoked when a signal terminates the program (see
atexit(3)). Hence, the log SHM log cleanup performed in i3_exit is not
invoked in that case. Second, compared to the shutdown path for the
'exit' command, we do not unlink the UNIX domain socket we create,
causing it to be leaked as well. Third, a handler for SIGTERM is not
registered at all despite handle_signal claiming to be the handler for
all 'Term' signals.
This change addresses all three problems and results in a graceful exit
including cleanup to happen when we receive a signal with the default
action 'Term'. It addresses issue #3049.
2017-11-28 23:29:47 -08:00
Michael Stapelberg 7a672a9d41 i3test: blockingly wait for events
…as polling the xcb file descriptor directly is not reliable.
2017-10-23 21:06:07 +02:00
Michael Stapelberg 7208df2d38 i3test: reliably warp the pointer to (0, 0) before tests start 2017-10-23 21:04:20 +02:00
Michael Stapelberg 5d55f93eb3 tests: add sync_with_i3 after open_window
We need to set dont_map => 1 on the sync window to prevent an endless loop.

Further, t/219-ipc-window-focus.t made assumptions about windows being named
incrementally, and that assumption is broken by the sync window opened by the
first sync_with_i3 call from open_window, so use the more reliable ->name.
2017-10-23 21:04:20 +02:00
Michael Stapelberg ce21de8dde Implement the tick event
This makes our tests less flaky, shorter, and more readable.

fixes #2988
2017-09-30 11:41:57 +02:00
Michael Stapelberg d968d39b27 Replace http:// with https:// where applicable
The testcases will be updated automatically in a separate commit.
2017-09-24 10:19:07 +02:00
Michael Stapelberg 363417e010 tests: remove the (broken) exit_gracefully check
I previously tried to fix the check, but could only come up with a fix which
required removing our module pre-loading, which makes the tests considerably
more expensive. Instead, let’s just remove the check.
2017-09-14 21:46:20 +02:00
Michael Stapelberg 02786155dc tests: use i3_config arg instead of precisely one launch_with_config
This way, tests are shorter, and i3test’s invocation of launch_with_config
parallelizes work better, using dont_block => 1.
2017-09-14 21:46:20 +02:00
Michael Stapelberg 53e7f18710 i3test::XTEST: don’t “use i3test” to avoid clobbering state
Before this commit, the $i3_autostart variable was accidentally overridden.
2017-09-14 21:45:48 +02:00
Orestis Floros fd7319683d Don't insert newline at end of config with launch_with_config 2017-09-13 15:30:37 +03:00
Vladimir Panteleev c6e3fbcf19
testcases/lib: Add inject_randr15_outputinfo argument
Allow tests to specify a file name for inject_randr15's
--getoutputinfo_reply command-line parameter.
2017-09-13 08:23:26 +00:00
Michael Stapelberg 94c76d9e30 i3test: add kill_all_windows convenience function 2017-09-10 11:30:56 +02:00
Michael Stapelberg a91544b5b3 testcases: remove external AnyEvent::I3 dependency 2017-08-19 18:13:19 +02:00
Michael Stapelberg 3e7a07e48d tests: add inject_randr15 (#2573)
This tool is similar to xtrace in usage in that it intercepts traffic to
the X server. The motivating feature for writing the tool is its ability
to inject prepared reply messages instead of the server’s reply. In
this particular case, we’ll inject a RRGetMonitors reply to test i3’s
RandR 1.5 code paths.

The added testcase is a noop for now, but with the code that’s lingering
in the randr15 branch, i3 does actually detect monitors as per the
injected reply:

    2016-11-20 21:10:05 - randr.c:__randr_query_outputs:618 -
      RandR 1.5 available, querying monitors
    2016-11-20 21:10:05 - randr.c:__randr_query_outputs:628 -
      1 RandR monitors found (timestamp 0)
    2016-11-20 21:10:05 - randr.c:__randr_query_outputs:646 -
      name DP3, x 0, y 0, width 3840 px, height 2160 px, width 520 mm,
      height 290 mm, primary 1, automatic 1

This is preparation work for issue #1799
2016-11-20 23:20:14 -08:00
Michael Stapelberg 84e70a19a8 testsuite: use relative paths, set PATH to absolute path
This approach works better with autotools, which supports the build
directory being complete outside the source tree.
2016-10-23 21:09:24 +02:00