Commit Graph

1168 Commits

Author SHA1 Message Date
Isaac Freund
ec8f57e704
Keyboard: check translated keysyms for mappings
If our current approch without xkbcommon translation does not match any
mapping on a key event attempt to match the translated keysym as well.

This makes e.g. the keypad number keys (e.g. KP_1) work intuitively as
they may require translation with numlock active.

The reason we stopped doing this in I7c02ebcbc was due to layout where
e.g. Super+Shift+Space is translated as Space with the Shift modifier
consumed, thereby conflicting with a separate mapping for Super+Space.
This should not be a issue anymore though as we now only run a maximum
of one mapping per key event and we attemt to match mappings without
xkbcommon translation before attempting with translation.
2024-01-11 15:06:33 -06:00
Isaac Freund
f6c434c7a7
river: log version during startup 2024-01-10 17:32:35 -06:00
Isaac Freund
cc1f988e56
Root: fix stack order on restore from 0 outputs 2024-01-09 13:11:16 -06:00
Isaac Freund
c38e7e2d87
Root: remove unneeded fallback.inflight lists 2024-01-09 13:03:55 -06:00
Isaac Freund
5947f04408
Seat: fix potential crash in handleMapping()
I haven't actually managed to reproduce a crash here yet but I feel much
more comfortable about this code with this change.
2024-01-07 16:55:10 -06:00
Leon Henrik Plickat
dd9933b6a1
keyboard-groups: use globber for identifier matching 2024-01-07 12:37:03 -06:00
Isaac Freund
540ca043df
Keyboard: fix mapping XF86ScreenSaver 2024-01-06 20:36:53 -06:00
Isaac Freund
afbc84c994
river: re-add wl_drm support for now
It seems to be a bit too early to drop support for this legacy protocol.

Xwayland apparently still relies on it for hardware acceleration as do
fairly recent mesa versions still in widespread use.
2024-01-06 19:23:55 -06:00
Wouter van Heijst
3605a46bb5 Cursor: Focus follows cursor focuses empty outputs
When `focus-follows-cursor` is set and the cursor moves onto an output
where no views are present on the currently visible tags, focus the
output itself instead of an individual view.

This is useful e.g. when you want to spawn a terminal on your empty
monitor or switch it to a different tag.  Previously such changes would
happen to the monitor on which you previous focus was, despite the
cursor being somewhere else.
2024-01-06 14:16:21 +02:00
Isaac Freund
9aa0f1a9a6
Output: fix possible crash on destroy 2024-01-05 12:50:36 -06:00
Isaac Freund
393bfb42b9
Keyboard: delete some uneeded code 2024-01-05 12:31:55 -06:00
Isaac Freund
913770975b
Cursor: clean up cursor theme loading
wlroots will now load xcursor themes at the correct scale automatically
based on the scale of the outputs where ther cursors are displayed.

Also make the error handling a bit more robust.
2024-01-04 14:44:51 -06:00
MaxVerevkin
9ce4525f08
river: Implement cursor_shape_v1 2024-01-04 14:14:00 -06:00
MaxVerevkin
9f0e0f2c0a
Cursor: actually set xcursor_name 2024-01-04 14:13:55 -06:00
Leon Henrik Plickat
c86f460135
Keyboard: Add new keyboards to groups if matched
Previously new keyboards would not be added to already existing
keyboard groups on (re-)connect. Only during the creation of
the groups themselves were devices added to them. This meant
that only keyboards connected during startup - before the init
is executed - would work with groups in a typical river session.
2024-01-04 11:00:16 -06:00
Isaac Freund
ebb6d1bdd1
xdg-activation: fix race with transaction system
This code could allows the view to be focused and urgent at the
same time if the request to activate the view is received just after
the pending focus has been set but before the transaction completes.
2024-01-04 10:10:31 -06:00
Isaac Freund
28dcd8320a
linux-dmabuf: send better per-surface feedback
This commit leverages the new wlr_scene helper to send custom feedback
per surface rather than using the same default feedback for every
surface. This should allow direct scanout to work more reliably with
multiple outputs for example.
2024-01-03 17:23:53 -06:00
Isaac Freund
80ced04f68
river: drop support for wl_drm
wl_drm is a legacy interface superseded by the linux-dmabuf
protocol. All clients should migrate.

This commit drops support for the protocol which should help find
whatever problematic clients are left in the wild.

If it turns out that this is too soon we can easily keep supporting
wl_drm for a little while longer as wlroots has not yet dropped support
for it.
2024-01-03 17:22:00 -06:00
MaxVerevkin
6a74ed99fa
river: Implement fractional_scale_v1 2024-01-03 12:47:31 -06:00
Isaac Freund
db70868c04
XdgToplevel: fix frame perfection on unmap
It looks like the old workaround for this wlroots API wart is no longer
sufficient for wlroots 0.17.
2024-01-03 12:39:43 -06:00
Isaac Freund
be4dbe3fe7
Keyboard: clarify keypress routing logic 2024-01-01 23:02:55 -06:00
Isaac Freund
40920c7818
TextInput: fix consecutive enable requests
The wording of the text-input-v3 protocol is quite confusing here
but I'm pretty sure this is now correct.
2024-01-01 23:02:55 -06:00
Isaac Freund
6f311af3b3
TextInput/InputRelay: style nits
There should be no functional changes in this commit
2024-01-01 23:02:55 -06:00
Isaac Freund
134a6bcfb5
TextInput: handle multiple text inputs correctly
The protocol states that we must send enter and leave to all text input
objects if the client has created multiple.

Only one text input is allowed to be activated by the client per seat
however.
2024-01-01 23:02:55 -06:00
Isaac Freund
49defcfb7a
TextInput: remove pending_focused_surface
This state doesn't need to exist, just get the focus from the Seat.
2024-01-01 23:02:55 -06:00
praschke
55ed16efd1
input-method: address nits 2024-01-01 23:02:55 -06:00
praschke
8f497a3570
input-method: check that the input method is active when committing 2024-01-01 23:02:55 -06:00
praschke
18d4ccdd38
input-method: send text-input enter event after all leave events 2024-01-01 23:02:55 -06:00
praschke
4af77f5ffb
input-method: setKeyboard already sends modifiers 2024-01-01 23:02:54 -06:00
praschke
2abab1e9c7
river: Implement input_method and text_input 2024-01-01 23:02:54 -06:00
Isaac Freund
3aba3abbcd
build: require at least wlroots 0.17.1
There are enough bugs fixed in 0.17.1 which are relevant to river that I
think it's worthwhile to refuse to compile against 0.17.1.
2024-01-01 22:55:15 -06:00
Isaac Freund
a128a574a4
output-management: work around wlroots crash 2024-01-01 22:52:25 -06:00
Isaac Freund
5f0c9e2ccf
output-management: fix output config application
Currently wlr-output-management config application is broken since the
pre 0.17 code relied on the (now removed) output enable/disable event to
be emitted as part of the state application.

The old code was pretty smelly and hard to understand, I'm glad the
upstream improvements pushed river's code in this directions.
2024-01-01 22:52:25 -06:00
Isaac Freund
b440767b54
gamma-control: track wlroots 0.17 changes 2023-12-29 16:22:15 -06:00
Isaac Freund
677766956e
deps: update to lastest zig-wlroots
This fixes a few issues with the XwaylandSurface bindings
2023-12-06 11:00:45 +01:00
Isaac Freund
093b85d234
build: fix comment on scanner.generate() versions 2023-12-05 11:37:15 +01:00
Isaac Freund
cf06498f22
ci: fix arch and alpine 2023-12-05 11:25:17 +01:00
Isaac Freund
deb671bec8
Output: fix initial commit for wayland backend
Also add some more logging
2023-12-05 11:06:27 +01:00
Isaac Freund
d207e08dab
Root: fix faulty assertion, cleanup
Thanks to tiosgz for prompting me to look at this more closely.

There doesn't seem to be any compelling reason to use the
wlr_scene_output_layout helper, it's simpler to just make the two
necessary SceneOutput.setPosition() calls manually. This will hopefully
be refactored down to a single call eventually as well.
2023-12-05 10:32:30 +01:00
Isaac Freund
1dc1ac02bc
Output: fix regression of initial mode logic
This logic that looked pointless to me while doing the wlroots 0.17
upgrade is in fact important as tiosgz helpfully pointed out.

It was added back in bc610c8b to address an issue. Hopefully the new
comments stop me from trying to break it again :)
2023-12-05 00:27:36 +01:00
Isaac Freund
6bfaf62cef
SceneNodeData: fix fromNode()
This currently fails to check the node passed and skips directly to the
parent.
2023-12-05 00:27:22 +01:00
Isaac Freund
7ee6c79b6b
build: update to wlroots 0.17 2023-12-01 17:29:05 +01:00
Isaac Freund
50ccd4c5b3
session-lock: fix pointer focus handling on map 2023-11-17 19:51:57 +01:00
Isaac Freund
68366c7331
Cursor: fix high polling rate resize regression
The previous commit ended up clamping the accumulated f64 offset to an
integer every frame, losing any sub-pixel cursor motions. This has been
known to cause problems with high polling rate mice in the past.

Return to the same approve the move cursor mode uses to solve this and
accumulate a separate sub-pixel delta.
2023-11-14 15:36:25 +01:00
Isaac Freund
c50ed9c7e7
Cursor: clamp cursor movement to resize bounds
Currently resizing a window allows moving the invisible "internal"
cursor infinitely far off screen despite the fact that the window is
bounded by the size constraints of the client and by the output
dimensions. This means that attempting to resize past these bounds in
one dimension will result in the "internal" cursor being far out of
bounds and will require an equal movement in the opposite direction in
order to continue resizing.

Exposing this implementation detail of an invisible "internal" cursor
separate from the rendered cursor is of course bad, so clamp it to the
bounds of the resize.
2023-11-13 22:54:36 +01:00
Isaac Freund
69b61602cf
View: handle map while no outputs are available
Currently views which are mapped while no outputs are available can
never actually get rendered because they have 0 tags and are stuck in
the hidden stack.

This commit fixes this and they should now be restored when a new output
becomes available.
2023-11-09 16:36:39 +01:00
István Donkó
927dceb071
keyboard: add the ability to load layout from file 2023-11-09 13:23:07 +01:00
Isaac Freund
04dea1edee
river: remove dead code
This file has been dead since the refactor to use the wlroots
scene graph deleted view_stack.zig
2023-11-09 00:08:56 +01:00
Isaac Freund
6c81990163
xdg-toplevel: ignore redundant move/resize requests
Such requests currently lead to an assertion failure.

I don't know what changed in nautilus 45.0 that caused it to start doing
this and I probably don't want to know.
2023-11-08 13:16:50 +01:00
Isaac Freund
c4fe1e1a3f
rules: rename "tag" action to "tags"
This rule action accepts and assigns a set of 32 tags represented as a
32 bit integer just like all of river's other commands handling tags.

Using the singular here is potentially misleading and is also
inconsistent with set-view-tags, etc. which all use the plural.

Sorry about the breaking change for those who use master branch, ideally
I would have caught this before merging but at least I noticed before a
release.

This commit also does a bit of internal refactoring/cleanup of the rules
system.
2023-11-08 11:33:27 +01:00