Commit Graph

475 Commits

Author SHA1 Message Date
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
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
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
489a49735a
river: update to wlroots 0.16 2022-11-13 16:16:07 +01: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
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
Zakariyya Von Forslun
bd03484b28 Xwayland: restrict OR focus changes based on ICCCM input model
Some popup menus are not covered by the `overrideRedirectWantsFocus()`
heuristic (e.g. in IntelliJ IDEA), so before focusing an OR window,
its input model should also be checked to ensure that it is able to
take input focus. This appears to fix the popup menus in IntelliJ IDEA,
which would otherwise disappear immediately due to unwanted focus.
2022-06-22 11:03:02 +02:00
Isaac Freund
5cce49095a
Seat: refactor InputDevice handling
- The lifetimes of the Keyboard and Switch structs are now directly
tied to the corresponding InputDevice, which has become a field of
those structs.

- Seat capabilities are now properly updated on removing a keyboard.

These changes align with input device refactoring in upstream wlroots
which will make updating to easier 0.16.0.
2022-06-21 16:25:37 +02:00
Isaac Freund
67d07e84b0
InputDevice: use "switch" in input device names
Currently we use "switch_device" because that's what the enum variant
happens to be named in zig-wlroots so that it doesn't conflict with the
switch keyword.

This however wasn't really thought through and "switch" makes more sense
to expose to the user.
2022-06-20 19:51:34 +02:00
Isaac Freund
c40dc5ee75
InputDevice: move to separate file 2022-06-20 16:29:35 +02:00
Zakariyya Von Forslun
9b04109c82 Cursor: fix focus for Xwayland override redirect windows
Setting focus on button click for override redirect windows did not
consider whether the window actually wants focus.
2022-06-09 15:10:55 +10:00
Leon Henrik Plickat
37da205be0
river: error out if default init is not executable 2022-06-06 21:53:55 +02:00
Isaac Freund
50c9e3d81b
Cursor: revive 'always' focus-follows-cursor mode
This was removed a while back because it was buggy and I didn't know
of anyone using it. Since refactoring it is now trivial to implement
and I know of at least one person using it, so I don't mind reviving it.
2022-06-03 12:03:08 +02:00
Isaac Freund
2df2151afa
river-status: only send mode event if client bound version 3 2022-06-02 12:21:57 +02:00
Isaac Freund
d657dc791b
river-status: add mode event to seat status
This allows clients such as a status bar to display the currently active
mode.
2022-06-01 00:15:09 +02:00
Isaac Freund
03e8da669c
Xwayland: Rename XwaylandUnmanaged to XwaylandOverrideRedirect 2022-05-30 01:08:09 +02:00
tiosgz
1e3b8ed161 Seat: avoid leaking eaten keys to client on focus
Until now, Seat.setFocusRaw sent all pressed keys to the client,
including ones that should be eaten. (Try e.g. changing focus to a
nested wlroots compositor with a terminal open to easily see it.)

However, only filtering out the eaten keys is not enough; they were
eaten only once all mappings had been executed. Therefore, the original
function had to be split into one looking up mappings and another
executing them.
2022-05-29 23:12:21 +02:00
tiosgz
6d6646febe Keyboard: eat key release event for mappings
Until now, only the event (press/release) for which a mapping was
present got eaten, and the other was passed to the client. From this
commit, a press mapping eats both events and a release mapping eats
nothing (and a press+release combo eats both).

This fixes behavior of some clients that do not make a difference
between press and release (e.g. Firefox with a fullscreen video
exiting fullscreen even on an Esc release event).
2022-05-29 23:12:21 +02:00
Zakariyya Von Forslun
e72afab140 Xwayland: add handling of override redirect listeners
Adding the set_override_redirect listener on creation and removing it
on destruction was missed when implementing override redirect state
change handling.
2022-05-29 17:21:15 +02:00
Isaac Freund
960afa89ec
View: refactor initialization
This anytype parameter is a wart that's been around for far too long.
2022-05-29 16:28:12 +02:00
Isaac Freund
6ef97eea24
Xwayland: handle override redirect state changes 2022-05-29 16:28:07 +02:00
Zakariyya Von Forslun
8a8dd9ff65 cursor: fix Xwayland unmanaged surfaceAt coordinates
The x and y coordinates for unmanaged Xwayland views were reversed
in the fullscreen branch of the surfaceAt() function.
2022-05-29 16:26:16 +02:00
Zakariyya Von Forslun
7b554bde68 xwayland-unmanaged: handle focus on map/cursor button
This implements keyboard focus on map for unmanaged Xwayland views
using wlroot's heuristic approach as well as keyboard focus on cursor
button click.
2022-05-29 16:26:16 +02:00
Isaac Freund
ded490d3dd
Output: remove overzealous assert
If running river with WLR_BACKENDS=headless, every output is headless
not just the noop output.
2022-05-20 15:13:28 +02:00
Isaac Freund
7122df7ec4
layer-shell: fix overflow if desired size exceeds output bounds 2022-05-16 19:03:23 +02:00