Commit Graph

5975 Commits

Author SHA1 Message Date
xzfc 103e78e04a Bugfix: avert endless loop on unexpected EOF at ipc messages (#3021)
Fix freeze on invalid ipc commands like

    echo -n $'i3-ipc\0\0\0\xa\0\0\0\0focus left' | socat - `i3 --get-socketpath`

Also, treat incomplete headers as IPC violation. Example of incomplete header:

    echo -n i3-ip | socat - `i3 --get-socketpath`
2017-11-09 11:18:23 -08:00
Ingo Bürk c207921949
Merge pull request #2980 from orestisf1993/issue-1160-pr
Use con_descend_focused for workspaces in _tree_next
2017-11-05 17:42:31 +01:00
Ingo Bürk b18f507b9b
Merge pull request #3030 from tylerbrazier/next
config: use ascii single quote
2017-11-05 17:37:53 +01:00
Ingo Bürk 01029da840
Merge pull request #3023 from orestisf1993/issue-2816
Add support to resize floating container in percentage
2017-11-05 17:27:48 +01:00
Tyler Brazier e0287e00d9 config: use ascii single quote
The unicode quote doesn’t render very well in terminals that don't
support unicode
2017-10-25 15:26:44 -05:00
Michael Stapelberg 787e799e3c Merge pull request #3028 from stapelberg/flakes2
Eliminate causes of flakyness
2017-10-25 08:56:02 +02:00
Michael Stapelberg 0d8b6714e3 Move XCB event handling into xcb_prepare_cb.
Previously, we used ev_check watchers, which are executed at the beginning of an
event loop iteration.

This was problematic if one of the handlers happened to fill the XCB event
queue, e.g. by reading a reply from X11 and an event happened in the meantime.

In that situation, we would hand control to the event loop, entirely ignoring
the pending event. This would manifest itself as a 1-minute hang,
reproducible (sometimes) in the i3 testsuite.

issue #2790 describes an instance of this issue in i3bar, and we fixed that by
changing the watcher priority to run last. Handling events in xcb_prepare_cb has
the same effect, as ev_prepare watchers are run just before the event loop goes
to sleep.
2017-10-23 21:06:13 +02:00
Michael Stapelberg 1946cc6cab t/525: remove flaky focus check 2017-10-23 21:06:13 +02: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 8e528d2de8 skip ConfigureNotify events with --force_xinerama
This prevents an i3 crash under certain conditions when running the tests.
2017-10-23 21:04:20 +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 4f751610c2 _NET_ACTIVE_WINDOW: invalidate focus to force SetInputFocus call (#3027)
The sender of the _NET_ACTIVE_WINDOW client message might know better when to
set focus than i3, as i3 does not know about unmanaged (override_redirect=1)
windows.

related to https://github.com/i3/i3lock/issues/35
2017-10-22 22:16:15 +02:00
Orestis Floros b17e7b82c6 Add support to resize floating container in percentage
resize set is modified to accept both 'px' and 'ppt' height and width.

Fixes #2816.
2017-10-18 02:07:11 +03:00
Ingo Bürk d4eaea8289 Merge pull request #2849 from Streetwalrus/next
Create a new split container when switching a workspace container to split layout
2017-10-15 22:23:40 +02:00
Michael Stapelberg 906a88e92b docs: full-size, so-called (#3019)
As per Michael Siegel, who studied the English language :).
2017-10-15 14:22:41 +02:00
Michael Stapelberg 4f03e49c3a userguide: explain why Mod4 is usually preferred (#3018) 2017-10-15 12:17:22 +02:00
Dan Elkouby 26014ca1a2 Default to L_SPLITH with toggle split when last_split_layout hasn't been initialized 2017-10-14 12:27:56 +03:00
hwangcc23 a34a0048a1 Add regression tests for #2846
1). Add one regression test in 167-workspace_layout.t:
    - Get a fresh workspace
    - Set the layout to something
    - Create windows
    - Try to switch to another layout
    - Check if successful
    - Repeat for all 12 possible transitions
2). Add another regression test in 167-workspace_layout.t:
    - Check that the command 'layout toggle split' works regardless of
      what layout we're using
2017-10-14 12:27:32 +03:00
Dan Elkouby c028f0cb17 Create a new split container when switching a workspace container to split layout
The behavior before 52ce8c8 was to do it regardless of what layout we're
switching to.

Fixes #2846
2017-10-14 12:26:47 +03:00
Michael Stapelberg 44a6efb5b0 tests: run under Xvfb by default (if available) (#2951)
This shaves off two seconds of wall-clock time (10s → 8s).
2017-10-13 00:18:49 -07:00
Michael Stapelberg 28ca1e8529 Fix AnyEvent->timer call (#3008)
And make the remaining AnyEvent->condvar and AnyEvent->timer calls
consistent.
2017-10-05 13:03:33 -07:00
Orestis 464c158d9a dump-asy.pl: use layout instead of orientation for names (#3004) 2017-09-30 10:17:20 -07:00
Michael Stapelberg ffa228e653 Merge pull request #3005 from stapelberg/tick
Implement the tick event
2017-09-30 10:16:43 -07:00
Michael Stapelberg 21cdcdb07c Fix compilation warnings on all Debian architectures. (#3007)
stbuf.st_size is of type off_t, which the standard defines as “extended signed
integral type”¹, and for which there is no correct printf format string. Hence,
we need to cast it into a hopefully-large-enough type (ugh) and use the
corresponding format string. In our case, int64_t should do it, as config files
really shouldn’t be anywhere close to those numbers.

① http://pubs.opengroup.org/onlinepubs/007908799/xsh/systypes.h.html
2017-09-30 10:16:21 -07:00
Michael Stapelberg 962750eb64 Fix memory leak when config conversion fails (#3006)
This happens on an empty config file, for example.
2017-09-30 10:15:58 -07:00
Michael Stapelberg 2bff4f1dba Synchronize with i3bar+i3, not just i3. 2017-09-30 13: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 14c8cf8622 tests: implement xtest_sync_with_i3
The regular sync_with_i3 is not sufficient because i3test::XTEST uses a separate
X11 connection.
2017-09-30 11:28:20 +02:00
Michael Stapelberg c08ef36199 docs/ipc: include new Go package, reference example byteorder code (#3000) 2017-09-29 14:02:18 -07:00
Ingo Bürk 7a7481e578 Deal with UTF8 in per-workspace-layout.pl. (#2997)
fixes #2996
2017-09-28 13:12:51 -07:00
Orestis Floros af78331ee7 Use con_descend_focused for workspaces in _tree_next
This way, when changing focus between outputs, the directional focus
command will focus the focused window within the parent container that
is next in the given direction.

Previously, the next window of the given direction was focused which is
Inconsistent with changing focus inside the same output.

Fixes #1160.
2017-09-28 16:48:50 +03:00
Ingo Bürk a05773e18b Merge pull request #2992 from orestisf1993/next
i3bar: fix segfault when no status_command is provided
2017-09-27 21:47:52 +02:00
Ingo Bürk 9aa016cffd Merge pull request #2995 from orestisf1993/dump-asy-basename
dump-asy.pl: use correct tmp dirname instead of hardcoded /tmp
2017-09-27 21:46:00 +02:00
Michael Stapelberg 54d61b510d Merge pull request #2953 from CyberShadow/focus_wrapping
Add "focus_wrapping" option
2017-09-27 09:31:39 -07:00
Orestis Floros 828ce9c640 dump-asy.pl: use correct tmp dirname instead of hardcoded /tmp
For example, on some systems, $rep might be saved in /tmp/$USER/ instead
of /tmp/.
2017-09-27 15:26:33 +03:00
Orestis Floros 4257107509 i3bar: fix segfault when no status_command is provided
Fixes #2933.
2017-09-26 02:50:10 +03:00
Vladimir Panteleev 50edf495aa
Merge "force_focus_wrapping" option into "focus_wrapping force"
Allow enabling forced focus wrapping by specifying "focus_wrapping
force" in i3's configuration. This syntax supersedes the previous
"force_focus_wrapping yes" one, which remains available for backwards
compatibility.
2017-09-25 18:58:12 +00:00
Pietro Cerutti 999bebc692 WIFEXITED needs sys/wait.h (#2989) 2017-09-25 09:11:15 -07:00
Ingo Bürk f4f3d649e2 Merge pull request #2985 from orestisf1993/next
Correct remaining string length for fill_rmlvo_from_root
2017-09-25 09:09:56 +02:00
Michael Stapelberg 89d6287110 update debian/changelog and release.sh after release (#2987) 2017-09-25 09:04:31 +02:00
Orestis Floros 65d00e0305 Correct remaining string length for fill_rmlvo_from_root
Fixes #2538.
2017-09-25 04:43:00 +03:00
Michael Stapelberg 362cbe6c5f docs/ipc: document the GET_CONFIG request (#2984)
This was neglected in commit a6d8ed9b1a

related to #2856
2017-09-24 17:25:41 +02:00
Michael Stapelberg 55bc674179 Merge pull request #2981 from stapelberg/https
Replace http:// with https:// where applicable
2017-09-24 13:11:01 +02:00
Michael Stapelberg 7ad32fd2d1 tests: replace http:// with https:// where appropriate
This was done automatically using:

% sed -i 's,http://build.i3wm.org,https://build.i3wm.org,g' testcases/t/*.t
2017-09-24 10:19:50 +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
Ingo Bürk 9fe508b791 Merge pull request #2977 from orestisf1993/issue-1627
Check container existance during drag events
2017-09-23 10:40:34 +02:00
Ingo Bürk 4ad9199a5c Merge pull request #2978 from orestisf1993/issue-2572
Issue 2572
2017-09-23 10:21:16 +02:00
Orestis Floros 414d23fb7a Check container existance during drag events
This fixes a crash that occurs when disabling floating for a container
while it is being moved or resized.

@Deiz describes the problem:
> It occurs because the command that disables floating runs before the
event loop. So, the window is tiled, its floating parent is destroyed,
but then a key event is handled which causes the position/size of the
now-destroyed parent to be modified.

Fixes #1627
2017-09-23 11:19:56 +03:00
Orestis Floros be9a2bb7f8 Add con_exists function
Checks the all_cons queue and returns true if a given con is found.
2017-09-23 03:22:20 +03:00