Commit Graph

1296 Commits

Author SHA1 Message Date
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
polykernel
2b463c9e4d
river: add fullscreen rule
This commit adds a fullscreen rule for configuring
whether the view should be drawn fullscreen on start up.

The actions "fullscreen" and "no-fullscreen" map to the two
possible state of a view and semantically operate on the same
rule list. The behavior of adding, deleting and listing rules
follows that of float and ssd.
2023-11-08 00:46:56 -05:00
polykernel
a0ea456ab2
river: add position and dimensions rules
This commit adds position and dimensions rules for configuring
the initial position and dimensions of views.

When a view is not matched by any position rules, it is centered
in the avaliable output space matching the current behavior. If
the provided position rule places the view outside of the output,
the view's position is clamped to the output bounds (with respect
to borders).

When a view is not matched by any dimensions rules, no default
dimensions is set by the server. If the provided dimensions rule
exceeds the minimum or maximum width/height constraints of the view,
the view's width/height is clamped to the constraints.

Position and dimensions rules have no effect if a view is started
fullscreen or is not floating. A view must be matched by a float
rule in order for them to take effect.
2023-11-08 00:46:55 -05:00
Isaac Freund
18a440b606
pointer-constraints: fix assertion failure
It is possible for the assertion in PointerConstraint.confine() to fail
if a view with an active pointer constraint is, for example, resized
using a keybinding such that the pointer is outside the constraint
region.

Handle this edge case by deactivating the constraint. The other option
would be to warp the pointer to the nearest point still inside the
constraint region. Deactivating the constraint is far simpler however
and I don't expect this to be a UX pain point.
2023-11-06 13:14:16 +01:00
Isaac Freund
642f9b7ae0
XdgToplevel: tweak fullscreen state policy
Currently river only sends the fullscreen state to a maximum of one
toplevel per output at a time and switching tags such that the
fullscreen toplevel is not visible causes the fullscreen state to be
removed.

This may be technically correct, but it causes issues when programs like
firefox trigger animations on fullscreen state change.

This commit returns river's policy here to what we did back in 0.2 and
leaves the xdg_toplevel fullscreen state set regardless of whether or
not the toplevel is currently rendered as fullscreen or if there are
other fullscreen toplevels.
2023-11-03 17:16:04 +01:00
Isaac Freund
59c9842c8f
Cursor: use inflight_mode as needed in updateState()
This fixes possible assertion failures when quickly cancelling and
starting a new move/resize. The following steps, take from the bug
report, can currently reproduce the race:

1. Start with a window in tiled mode.
2. Begin resizing the window with your cursor.
3. Send the window back to tiled mode (with a keybind) and quickly begin
resizing it again with your cursor.
2023-11-03 17:06:05 +01:00
tiosgz
ddc7997d2f riverctl(1): add a section on terminology
It is not unusual to see people coming to river directly from X11,
confused by some things being renamed (and by river having tags). Give
them some basic help for reading the manpage and understanding our talk.
2023-10-30 13:53:01 +00:00
Isaac Freund
5da4769c23
rivertile: eliminate an @intCast()
It's pretty cool that the new @min() and @max() builtin semantics allow
this.
2023-10-26 00:04:11 +02:00
Isaac Freund
4cb65f9e2e
DragIcon: set position on creation
Currently if a drag icon is created but the cursor/touch point is not
moved river will render the drag icon at 0,0 instead of the cursor/touch
point location. This fixes that.
2023-10-25 22:01:05 +02:00
tiosgz
3fb229a71d
editorconfig: reflect state of bash completion 2023-10-25 19:13:53 +02:00
tiosgz
57366c487f
completions/bash: complete input devices, fix typos 2023-10-25 19:13:53 +02:00
tiosgz
ffe004ecec
completions/fish: partial overhaul
Try to fix -h and -version. Remove seemingly superfluous -x everywhere,
only use one -f. Use -o for options. Update input devices listing.
Deduplicate some args. Try to do better for rule-add and rule-del.
2023-10-25 19:13:20 +02:00
Isaac Freund
0729b9122b
docs: update PACKAGING.md for Zig 0.11 2023-10-25 12:16:50 +02:00
Isaac Freund
3fa44d8509
docs: explain unknown info in output identifiers 2023-10-21 12:01:42 +02:00
Doclic
bf4154007d river: add outputs rule 2023-10-19 12:58:11 +02:00
Doclic
206bb2e713 river: make RuleList return deleted items 2023-10-19 01:21:52 +02:00
Hugo Machet
ad1e0aa752
completions/zsh: Fix incomplete input names
Input name with ':' in it were not suggested entirely.
2023-10-18 13:23:47 +02:00
Hugo Machet
de5f21cbb4
completions: Rewrite zsh
- Fix some completions that never really worked correctly, e.g `riverctl
  input` didn't take the input name into account. Same with rule that
  didn't take into account glob.

- Add a lot of documentation to help people adding new commands.

- Add new rule-[add|del] order.

- `riverctl input` now autocomplete input name from `riverctl
  list-inputs`
2023-10-18 12:17:10 +02:00
Isaac Freund
f364e1b81b
Cursor: use total delta for resize calculation
This means that interactive resize speed is no longer throttled by the
speed at which the client commits new buffers. Interactive resize speed
is now determined entirely by how fast the pointer input device is moved
by the user.

This may result in more subjectively "choppy" resizes for clients that
commit very slowly, but it should be less sluggish at least.
2023-10-17 19:10:41 +02:00
tiosgz
d73ef51c89 riverctl: rule-{add,del}: reorder parameters
Previous order was (action, conditions, action argument), current is
(conditions, action, action argument). The old one was an expansion of
(action, conditions), which itself most likely came from the separate
<action>-filter-add commands. On the other hand, the new order keeps
action and its argument together and is in line with the logical flow
(check conditions, apply action).

On shell completions: only bash absolutely needed to be updated. fish
and zsh slightly misbehave regardless of the order.
2023-10-16 17:04:40 +00:00
Isaac Freund
5690c833e9
View: clean up after Zig update 2023-10-16 16:42:33 +02:00
Isaac Freund
2e586c7061
build: update to Zig 0.11.0 2023-10-16 16:27:03 +02:00
tiosgz
7f30c655c7
Cursor: keep focus_follows_cursor_target updated
This goes as close as possible to the behavior before this state was
introduced (keeping the improvement which needed it, 931405ab), fixing
various mis-interactions of keyboard and focus_follows_cursor focus
changes.

The following text is irrelevant to restoring correct basic FFC behavior
and talks about less common scenarios with regards to FFC clashing with
views' input region beyond their geometry, continuing the work done in
931405ab.

Scenario 1: the cursor traveling along a view's border in a "dead zone",
never initiating a focus change. If the focused view has an extended
input region, that area has some functionality (such as client-initiated
resizing); therefore it should be respected and even if another view's
geometry is also under the cursor, focus shouldn't change. In case of
unfocused views, it is a matter of consistency with the focused-view
case. This outcome is also easier to implement, as it doesn't require
any additional code.

Scenario 2: *clicking* such a dead zone, i.e. extended input region (of
an unfocused view). In question is not whether to focus the view (yes),
but whether the focus_follows_cursor_target should be set to the view as
well. Only one case seems relevant to me here, which is when ffc_target
is another view whose geometry is under the cursor, but covered by this
newly-focused view's input region. The most likely action following the
click is resizing the newly-focused view, where a touchpad or faulty
mouse could make the cursor move a bit farther after the button has been
released. I believe that ffc_target shouldn't have been updated, in
order to now prevent focus from skipping away.
(Another variant is me, wondering why the wrong view got focused and
trying to focus the right one using FFC. In that case, however, one
could ask if it's river that misbehaves and whether the application is
really well-integrated into the user's desktop when it provides a
feature they don't desire.)
2023-09-05 12:25:42 +02:00