Commit Graph

955 Commits

Author SHA1 Message Date
Orestis a3a7d04a43 291-swap.t: make tests fail less (#2964) 2017-09-18 18:02:38 +02:00
Michael Stapelberg d1296cd1cf Bugfix: don’t invalidate layout upon invalid 'layout toggle' params (#2965)
fixes #2903
2017-09-18 16:36:57 +02:00
Orestis Floros fa5d8a0209 Make swap work with fullscreen windows
Swap works like normal with fullscreen windows but swaps the fullscreen
mode of the 2 containers after it's done.

Fixes #2811
2017-09-16 13:49:20 +03:00
Ingo Bürk 8cad1c1fa6 Merge pull request #2887 from orestisf1993/next
Allow assign to workspace by number
2017-09-15 21:26:35 +02:00
Michael Stapelberg 6b8e3560ef Merge pull request #2950 from CyberShadow/pull-20170914-153533
Fix erratic behavior with single container child jumping outputs
2017-09-15 11:31:33 +02:00
Vladimir Panteleev 480f688b44
Fix erratic behavior with single container child jumping outputs
This fixes a regression introduced in commit
4e88c10564ca5366c2578908f62ec56625a26718: when attempting to move the
single child of a container in the direction of another output, i3
would move the window to the output, despite the window not being at
the edge of its output, instead of moving it to its parent container.

The bug occurred because the check for moving containers across
outputs with non-default workspace layouts (issue #1603) did not
actually verify that the moved window lies at the edge of the
workspace, despite what its comment said.

Fixes issue #2466.
2017-09-15 09:27:32 +00:00
Orestis 00912add46 Use numeric comparison in sort for $displaynum (#2952)
Eg in the case of sockets:
- X0
- X99
- X100

X99 would be picked instead of X100.
2017-09-15 11:21:35 +02:00
Orestis Floros eaf7a49e28 Allow assign to workspace by number
Makes "assign [<criteria>] workspace number <number>" work in the same
manner as "move to workspace number <number>" instead of assigning the
window to a workspace named "number <number>".

config.spec is modified to expect a 'number' string and an extra
argument is used in cfg_assign.

For workspaces that don't exist yet, workspace_get is used as a
fallback. This also allows the user to assign to "<number> <workspace>"
eg "2: work" and the full name will be used if workspace number 2
doesn't exist yet.

Fixes #2590.
2017-09-15 03:38:13 +03:00
Orestis 6411130c85 Add -name argument for Xephyr (#2937)
This way you can assign the test windows to an empty workspace to avoid
interacting with them (when xvfb-run is not an option):
assign [instance="i3test"] workspace testing
2017-09-14 22:10:16 +02:00
Michael Stapelberg 24462f98ae tests: unflake tests by not starting i3bar 2017-09-14 21:46:20 +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
Michael Stapelberg 3a31a76b2a Reorder tests to not use the same number (#2947)
Distinct numbers make re-running individual tests easier by helping with
tab-completion.

Completeness verified using:
% for i in $(seq 0 600)
do
  files=$(ls testcases/t/$(printf "%03d" $i)-*.t 2>&- | wc -l)
  [ "$files" != "0" ] && [ "$files" != "1" ] && echo "clash: $i"
done
2017-09-14 17:49:02 +02:00
Michael Stapelberg a5aed10d09 tests: unflake t/257-keypress-group1-fallback.t (#2946)
fixes #2944
2017-09-14 17:48:37 +02:00
Michael Stapelberg b23e1f644f Bugfix: free incomplete containers when JSON parsing fails
related to #2755
2017-09-13 16:39:13 +02:00
Orestis Floros 7b0f4abf4f scalloc parse_config input to make sure it terminates with '\0'
Otherwise strchr() can crash for files that don't end with '\n' because
it won't find a null char to terminate at.

Fixes #2934
2017-09-13 15:31:53 +03: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 9be4199e13
533-randr15.t: Add test for bar output name canonicalization 2017-09-13 08:23:27 +00:00
Vladimir Panteleev fbeded23a9
533-randr15.t: Stop hard-coding the output name
Refactor away all mentions of DP3.
2017-09-13 08:23:27 +00:00
Vladimir Panteleev 8a0e5f89f9
533-randr15.t: Add a fake output connected to the fake monitor
Add an output ID to the simulated RRGetMonitors reply, then add a
simulated RRGetOutputInfo reply describing the added output.
2017-09-13 08:23:27 +00: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
Vladimir Panteleev de1b578f75
inject_randr1.5: Intercept X11 error responses in addition to replies
Allow clients to send garbage to the server, then intercept the
server's error response and substitute it with the supplied simulated
reply data.
2017-09-13 08:23:26 +00:00
Vladimir Panteleev f88f4fb5d4
inject_randr1.5: Add RRGetOutputInfo reply injection
Add a --getoutputinfo_reply switch to indicate a filename containing
the RRGetOutputInfo reply data to inject.
2017-09-13 08:23:26 +00:00
Vladimir Panteleev dfc5ad9850
inject_randr1.5: Refactor reading and storing reply buffer to a struct
Allows easier introduction of additional reply buffers in upcoming
changes.
2017-09-13 08:23:26 +00:00
Michael Stapelberg 1c94d189c3 tests: run 533-randr15.t at the very end
The test runs `xrandr setmonitor`, which will otherwise affect any test
scheduled after 533-randr15.t, causing flakyness in t/217-NET_CURRENT_DESKTOP.t
for example.
2017-09-10 21:03:14 +02:00
Michael Stapelberg 06e8f75d52 tests: unflake t/263-edge-borders.t 2017-09-10 21:03:14 +02:00
Michael Stapelberg bed5c9e03a tests: re-seed random number generator in workers 2017-09-10 21:03:13 +02:00
Michael Stapelberg 1b18f89422 Merge pull request #2923 from stapelberg/tests-split
Testsuite: avoid starting new i3 instances where possible
2017-09-10 13:41:46 +02:00
Michael Stapelberg f7565b5f32 Kill windows between tests 2017-09-10 11:31:10 +02:00
Michael Stapelberg 94c76d9e30 i3test: add kill_all_windows convenience function 2017-09-10 11:30:56 +02:00
Michael Stapelberg 6caf4e1cb5 testcases/Makefile.PL: tell MakeMaker this is a pure-Perl distribution (#2922)
fixes #2914
2017-09-10 11:25:43 +02:00
Michael Stapelberg 899ffd872f 529-net-wm-desktop: avoid timeout, avoid restarts, split
This shaves off almost half a second of the wall-clock time (from 5.9s to 5.6s).
2017-09-09 18:39:56 +02:00
Michael Stapelberg ffd0ebd85c 165-for_window: merge config and re-use i3 instance, split remainder
This reduces total test wall-clock time by 1.5s (from 7.5s down to 5.9s).
2017-09-09 18:21:59 +02:00
Michael Stapelberg c86307864f t/265-swap: don’t start new i3 instances with the same config
$config is never touched after being initially set up.
Not restarting i3 between each test case reduces the runtime of this test by an
order of magnitude.
2017-09-09 17:50:23 +02:00
Orestis Floros e5008ca0dc Improve 267-regress-mark-restart.t
Another window with a mark is needed for issue #2900.
2017-09-07 04:20:52 +03:00
Orestis b12cea0ad2 Fix typo in 265-swap.t 2017-09-06 18:02:52 +03:00
Orestis 66f2148236 Check if con_id exists in cmd_swap (#2898)
Also adds some testcases for swap using con_id.

Fixes #2895
2017-09-06 07:34:14 +02:00
Michael Stapelberg 4dca8e6e0b Respect focus_on_window_activation for ConfigureRequests (#2889)
fixes #2873
2017-08-28 12:07:56 +02:00
Michael Stapelberg c9676e0cdb t/264-keypress-numlock: add mouse binding test
fixes #2523
2017-08-20 18:00:58 +02:00
Michael Stapelberg 260bcf283f Respect dont_warp flag when moving containers (#2867)
fixes #2681
fixes #2592
2017-08-20 17:07:23 +02:00
Michael Stapelberg c70fa8078f Focus windows upon ConfigureWindow with stack-mode=Above (#2865)
fixes #2708
fixes #2745
2017-08-20 14:56:44 +02:00
Michael Stapelberg 1e349ae3e1 t/201-config-parser: update expected token list 2017-08-20 13:12:06 +02:00
Michael Stapelberg a6d8ed9b1a Introduce the GET_CONFIG IPC request
This introduces memory usage by one copy of the config file, which is an
acceptable trade-off for being able to easily revert data loss.
The default config is 6KB, user configs will be in the same ballpark.

fixes #2856
2017-08-19 19:08:51 +02:00
Michael Stapelberg a91544b5b3 testcases: remove external AnyEvent::I3 dependency 2017-08-19 18:13:19 +02:00
Michael Stapelberg 5738ea10bb t/171-config-migrate: escape braces for newer Perl versions 2017-08-19 17:45:37 +02:00
hwangcc23 cc4be41674 Fix 'rename workspace to tosomething'
This patch fixes the issue #2802 (https://github.com/i3/i3/issues/2802).

1). Revise the state machine for the 'rename workspace' command.
    These scenarios are considered:
    a). 'rename workspace to to bla'
        state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_LIKELY_TO -> RENAME_WORKSPACE_LIKELY_TO_NEW_NAME
    b). 'rename workspace to tosomething'
        state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_LIKELY_TO
    c). 'rename workspace to to'
        state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_LIKELY_TO
    d). 'rename workspace to bla'
        state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_LIKELY_TO
    e). 'rename workspace bla to foo'
        state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_TO -> RENAME_WORKSPACE_TO_NEW_NAME

2). Add a test case in 117-workspace.t for the scenario b.
2017-06-12 22:21:21 +08:00
Michael Stapelberg a4f6387911 compare modifiers for equality, not subset (+test)
Subset comparison was introduced with the rather large commit
bf3cd41b5d, but I now think we should use
equality.

In other words, the following key binding:

    bindsym Mod4+x nop Mod4+x

previously would have been triggered when pressing Mod3+Mod4+x.

Strictly speaking, this is a change of behavior, but it breaks none of our
tests, and using equality instead of subset comparison enables more use-cases.

fixes #2002
2017-05-24 20:42:27 +02:00
Chih-Chyuan Hwang 13372d511a Fix the i3 crash caused by mark + restart commands (#2779)
This patch fixes the issue #2511(https://github.com/i3/i3/issues/2511).

1). Memorize the marks, but only call con_mark once the container has finished parsing. (Credit: This is @Airblader's patch.)

2). Add a test case 267-regress-mark-restart.t for regression test to check if mark and restart command crash i3.
2017-05-23 08:47:11 +02:00
Michael Stapelberg 2bd3639fbb Fix --release bindings broken by previous commit
fixes #2559
2017-05-23 08:28:56 +02:00