Commit Graph

1163 Commits

Author SHA1 Message Date
Isaac Freund
8f8d94aa45
session-lock: fix potential race
Currently the session lock client has no 100% safe way to know when it
is safe to suspend after requesting that the session be locked.

For a suspend to be safe the compositor must have either blanked or
rendered a lock surface on all outputs before suspending. This is
because the current framebuffer on suspend appears to be saved and
displayed again after suspend, at least on my Linux system.

If a new "locked" frame for all outputs is not rendered before suspend,
an "unlocked" frame or frames will likely be briefly displayed on resume
before the lock surfaces are rendered or the screen is blanked.

To fix this, wait until a lock surface has been rendered on all outputs,
or if that times out until all outputs have been blanked, before sending
the locked event to the client.

Resolving this race on the compositor side without protocol changes
is the most effective way to avoid this potential information leak,
regardless of which session lock client is used.
2022-12-29 18:25:12 +01:00
Leon Henrik Plickat
5d4c2f2fbd river: fix resize command
In 489a49735 the view.move() call, which is used to keep the view centered after
a resize, was accidentally removed.
2022-12-29 14:56:06 +01:00
Isaac Freund
e18d0d5e1c
flags: automatically prepend '-'
This makes the usage a bit cleaner as the results of the parsing may be
accessed with e.g. ret.flags.version instead of ret.flags.@"-version".
2022-12-28 22:11:14 +01:00
Isaac Freund
2be9ac05d6
command/map: use flags.zig, cleanup 2022-12-28 21:56:42 +01:00
Isaac Freund
eed7d94557
docs: improve keyboard layout documentation
- Remove recommendation of XKB_* environment variables in river(1) as we
  now have a dedicated riverctl keyboard-layout command.

- Give an example of how to use and switch between multiple layouts in
  the riverctl(1) man page.
2022-12-28 20:43:54 +01:00
Isaac Freund
0cb6b3f81d
command/keyboard-layout: use flags.zig, cleanup 2022-12-28 20:21:23 +01:00
Isaac Freund
16cbe5f469
flags: rewrite to allow [:0]const u8 arguments
This also cleans up the code by using @Type(), eliminating the need
for the argFlag() and boolFlag() functions.

Allowing [:0]const u8 arguments makes this parser useful for
river-control commands as well.
2022-12-28 20:21:23 +01:00
Leon Henrik Plickat
ad1dbb1180
river: add keyboard-layout command
This allows switching river's keyboard layout at runtime.
2022-12-28 20:20:36 +01:00
Andrea Feletto
2eb0a7a75c
river: support wp-single-pixel-buffer-v1 2022-12-24 20:14:30 +01:00
Isaac Freund
6ac3928556
idle: support ext-idle-notify-v1, drop KDE protocol
This commit is a breaking change as it drops support for the now
obsolete org_kde_kwin_idle protocol.
2022-12-24 18:18:09 +01:00
Isaac Freund
05c9194eba
build: handle wlroots built without xwayland support 2022-12-24 17:38:02 +01:00
Isaac Freund
096e175cec
View: honor fullscreen requests before map 2022-12-24 03:06:53 +01:00
MaxVerevkin
e603c5460a
river-status: correctly advertise version 4
This should have been a compile error but slipped through due to a bug
in zig-wayland. This bug has now been fixed and the submodule updated.
2022-12-02 15:19:13 +01:00
Aiz
76000c3603 river-status: fix typo in layout_name_clear description 2022-12-02 14:43:09 +01:00
Isaac Freund
4af7a3cb63
river-layout: fix version of layout_name events 2022-12-01 16:10:08 +01:00
Leon Henrik Plickat
b8e2ee2a0c
river-status: expose current layout name 2022-12-01 15:51:00 +01:00
shironeko
8036ae2bd1
Cursor: add on-focus-change option
Warp the cursor to the center of the focused view if the cursor is not
in the bounding box of that view already. This helps the user to keep
track of their cursor when they mostly use the keyboard and the cursor
becomes hidden most of the time, also helps trackpad/trackpoint users.
2022-12-01 14:23:02 +01:00
Isaac Freund
3141940efb
map-pointer: minor fixes and cleanups 2022-11-25 14:06:31 +01:00
Alexander Courtis
cacc986166
map-pointer: allow running arbitrary commands 2022-11-25 14:05:36 +01:00
Isaac Freund
e2a27b3a4e
example/init: run rivertile in background
There have been multiple "bug reports" from users that have added more
configuration using riverctl after this line starting rivertile and were
confused why that configuration has no effect.

It's not our job to explain how POSIX shell works, but we can make the
example a bit more foolproof for those who do not yet have experience
with it
2022-11-25 12:40:11 +01:00
Isaac Freund
3ed71c51e2
deps: update to latest zig-wlroots
This fixes a crash handling switch toggle events
2022-11-20 11:33:42 +01:00
taupiqueur
5dc591fe2d
docs: fix typo in readme 2022-11-17 14:58:08 +01:00
Isaac Freund
cce729d89d
session-lock: send wl_pointer.enter immediately 2022-11-13 16:45:18 +01:00
Isaac Freund
98d2f6a568
session-lock: add basic logging 2022-11-13 16:45:18 +01:00
tiosgz
49efbfe046
session-lock: handle output unplugging better 2022-11-13 16:45:18 +01:00
Isaac Freund
33187e0b09
ext-session-lock: implement protocol 2022-11-13 16:45:18 +01:00
Isaac Freund
78a46c316a
input-inhibit: remove support for protocol
The only valid use-case for this as far as I'm concerned is lockscreens,
which will now be supported through ext-session-lock-v1.
2022-11-13 16:45:18 +01:00
Isaac Freund
ba823ef96e
ci: remove Void Linux CI
This doesn't really seem worth keeping as glibc linux is already covered
by the Arch Linux CI and Void lags behind on package updates enough
compared to the others to be annoying.
2022-11-13 16:37:14 +01:00
Isaac Freund
29f32639a6
ci: update to wlroots 0.16.0 and wayland 1.21.0 2022-11-13 16:36:21 +01:00
Isaac Freund
489a49735a
river: update to wlroots 0.16 2022-11-13 16:16:07 +01:00
Campbell Barton
5eb0e23780
contrib: mention default-layout command in FAQ
It took me a while to figure out how to activate this layout, adding a note to the Q&A.
2022-10-26 10:29:23 +02:00
Isaac Freund
e35c147cd5
river: refactor keyboard groups implementation
This reduces the impact of keyboard groups on the Keyboard.zig
implementation and otherwise improves consistency with patterns used
elsewhere in rivers code.

There are also two small changes to the riverctl interface:

- keyboard-group-add-keyboard is renamed to keyboard-group-add
- keyboard-group-remove is added to support removing keyboards from a
group.
2022-09-18 15:53:45 +02:00
Leon Henrik Plickat
01f49bbbc1 river: add keyboard groups 2022-09-12 04:12:21 +02:00
Isaac Freund
c0e64829f0
layer-shell: start transaction on map
The fact that this call is missing is a bug, as the changes made by
arranging the output layers as well as changes to the focus will not be
fully applied.
2022-08-25 13:24:42 +02:00
Leon Henrik Plickat
29ae7ba311 river: advertise correct version of layout protocol 2022-08-19 00:04:16 +02:00
Leon Henrik Plickat
844ffce037
river-layout: add user_command_tags event
It is not guaranteed that the next layout_demand event after a user_command
event has the same active tags (for example when there are no views visible).
As an example, a user could trigger a user_command while no views are visible,
then switch to a different tag set which has active views. The active tags of
the previous layout_demand may also be different.

Therefore it is impossible to correctly implement a layout generator which has
user commands apply only to the currently active tag set, which is solved by
this patch.
2022-08-16 13:40:07 +02:00
Isaac Freund
416fdc8d06
layout: only arrange on user command if layout is active 2022-08-15 15:51:40 +02:00
Leon Henrik Plickat
765a3f4aff river: keep floating views within bounds when sending to output 2022-08-11 15:22:07 +02:00
Isaac Freund
1a9cba2aa9
river: fix SIGPIPE handling, cleanup fork/execve
Installing an empty handler does not have the same effect as using
SIG_IGN as the failing write syscall will not return EPIPE.
2022-08-11 12:02:30 +02:00
shironeko
600fd2e73c river: ignore SIGPIPE to avoid weird exits
When river or wlroots write to a closed socket it could generate SIGPIPE
causing the whole desktop to seemingly "crash" with no error log of any
kind. So we ignore the SIGPIPE and just let the write fail with EPIPE to
be handled normally.
2022-08-10 20:44:22 -04:00
Isaac Freund
d4b2f2b0fc
Seat: send enter event on keyboard device creation
Currently we don't send an enter event when a new keyboard device is
created which causes issues when switching ttys. On switching away the
keyboard device is destroyed and leave is sent. Currently on switching
back the keyboard device is re-created but no enter event is sent before
we start sending key events, which is a violation of the protocol.
2022-07-26 16:25:04 +02:00
tiosgz
7443e1377a
LayoutDemand: handle too many view dimensions correctly
The condition was wrong for the first extra view (0 isn't < 0), plus
the counting stopped at that moment.
2022-07-19 13:17:09 +02:00
tiosgz
55cf8ad669 XdgPopup: fix unconstrain rect with layer surfaces
The used coordinates store where the layer is on the output, but we
need the opposite.
2022-07-18 18:27:57 +00:00
tiosgz
bc610c8b82 Output: retry other modes if preferred fails
In cases like multiple hi-res monitors connected through a USB dock, the
preferred mode can fail to work. Such an output was then ignored by river,
which made it impossible to even set another mode manually.

Sway has been reported to solve this issue, so let's employ their solution
and fall back to another mode if possible.
2022-07-10 19:17:15 +02:00
Isaac Freund
403eca90a5
ci: explicitly install libevdev
This is currently pulled in transitively on void, arch, and FreeBSD
which just stopped working on void due to upstream changes.
2022-07-10 19:00:17 +02:00
tiosgz
b58bd829c2
docs: better connect 'index' to -layout in riverctl(1) 2022-07-02 21:46:12 +02:00
Isaac Freund
7402cb8aea
deps: update to latest zig-wlroots
This fixes the return type of Foo.fromWlrSurface() functions which can
in fact return null in the edge case that the role matches but the
corresponding object has already been destroyed.
2022-07-01 20:53:45 +02:00
Isaac Freund
db366e9455
Xwayland: fix View.fromWlrSurface for OR surfaces 2022-06-24 12:05:54 +02:00
Isaac Freund
7d9d889226
deps: update to latest zig-wlroots
This fixes a nasty ABI bug that could cause river to crash when
hotplugging down to 0 outputs.
2022-06-23 18:50:00 +02:00
Isaac Freund
2eb013e214
Cursor: implement initial touch support
Still TODO are:
- Touch support for drags
- Mapping input devices to outputs (necessary for good multi-monitor
touch support)

Co-authored-by: Daan Vanoverloop <daan@vanoverloop.xyz>
2022-06-22 11:06:35 +02:00