Commit Graph

1162 Commits

Author SHA1 Message Date
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
tiosgz
0cc930b738 Root: fix inflight_layout_demands counting
Not decreasing the counter caused a weird bug where disabling/removing
an output (curiously, it seems to apply only to last active output being
removed) would lock the user out of the session, not letting the
transaction to complete (therefore hiding all views on a newly added
output) and messing up focus.

Fixes https://github.com/riverwm/river/issues/830
2023-08-13 11:22:28 +00:00
tiosgz
4726a6b0f1 Root: migrate {all,active}_outputs to wl.list
As discussed with ifreund on irc. This avoids extra allocation in case
of all_outputs and confusion in case of active_outputs (because with the
Output embedded in the Node, i thought its value was copied instead of
its pointer).
2023-08-13 11:10:46 +00:00
tiosgz
8966f95e72 Root: make 'fallback output empty' assertion stricter 2023-08-13 11:06:57 +00:00
tiosgz
57186fced3 Root: rename field outputs to active_outputs
Although this list only including active outputs was already documented,
making this explicit in its name reduces confusion and debugging
overhead.
2023-08-13 11:06:25 +00:00
tiosgz
bbd21c1637 river: update some comments
Mostly stuff not reflecting renames, plus a few if-then comma errors i
noticed.
2023-08-03 10:52:16 +00:00
Leon Henrik Plickat
c16628c7f5 river: fix spatial direction focusing / swapping 2023-07-11 01:11:40 +02:00
Leon Henrik Plickat
b35d779122 river: focus-view and swap by spatial direction 2023-07-09 23:20:06 +02:00
Leon Henrik Plickat
5ce2ca1bc0 river: fix crash when trying to add tag rule without tag argument 2023-07-02 19:21:52 +02:00
Leon Henrik Plickat
0b142bd16b river: add tags rule 2023-06-28 15:38:32 +02:00
Leon Henrik Plickat
a98de941d0 river: change order of colums in list-rules command
This will make it easier to extend the command later for new rules
2023-06-27 10:47:44 +02:00
Leon Henrik Plickat
9b5ea39580 river: allow settings child type of RuleList 2023-06-27 10:44:28 +02:00
Isaac Freund
470eb22280
river-layout: Remove incorrect assertion
This assertion is not correct since removing transaction preemption.
2023-06-20 15:26:29 +02:00
Leon Henrik Plickat
93a567ca94
riverctl: Add error messages for failed connections 2023-06-05 20:01:27 +02:00
Isaac Freund
6e2169a149
XdgToplevel: store scene node in wlr_surface data
This was accidentally removed in 05eac54b077, which broke
SceneNodeData.fromSurface() for xdg_toplevels.

This means that thing such as xdg-activation and idle inhibit didn't
work since that commit and should work again starting from this commit.
2023-06-05 19:49:39 +02:00
Väinö Mäkelä
792d94253c
XdgToplevel: keep wlroots updated on view sizes
When sending a configure, wlroots will send the same size that was sent
on the previous configure unless a new size is set. If a client resizes
their window itself, the size wlroots has in
XdgToplevel.scheduled will be obsolete and needs to be updated by river.
2023-05-11 23:02:34 +02:00
Sage Hane
5de9bf846b editorconfig: fix typo 2023-05-02 13:37:37 +00:00
Pablo Ovelleiro Corral
b369815070
command/send-to-output: add -current-tags flag 2023-03-25 14:32:31 +01:00
tiosgz
e207a0e03a
Server: remove debug leftover 2023-03-24 16:57:36 +01:00
Isaac Freund
3865a7be7c
session-lock: fix assertion failures and clean up
The removed assertions aren't possible to guarantee due to the fact that
the lock render state is updated asynchronously as the output is
rendered.
2023-03-24 15:27:25 +01:00
Isaac Freund
eaa2f6d37e
LayerSurface: fix surfaces on multiple outputs at once
The previous commit broke handling of keyboard interactive
layer surfaces being created on multiple outputs at once.

This new approach reverts part of the logic change in the previous
commit while keeping the fix for the crash and the new assertion.
2023-03-16 15:10:52 +01:00
Isaac Freund
133b88c266
LayerSurface: handle focus when switching outputs
Currently if a layer surface is focused and the user focuses a different
output the layer surface remains focused. However, updating focus on
layer surface unmap only considers seats that have the layer surface's
output focused.

To fix this there are 3 approaches I see:

1. Unfocus all layer surfaces on the old output when switching output
focus, focus any layer surfaces on the new output.

2. Disallow switching output focus while a layer surface is focused.

3. Stop caring about output focus when determining which layer surface
should gain/lose focus.

I've taken the 3rd option here as it is significantly simpler to
implement and maintain but still feels reasonably intuitive.
2023-03-16 11:03:33 +01:00
Isaac Freund
50c6ae245f
build: work around zig 0.10.0 bug to fix CI 2023-03-15 17:34:10 +01:00
Isaac Freund
c2ce893dd0
Cursor: apply x/y change during resize on commit
This fixes issues with resizing clients that stick to a fixed aspect
ratio during resize such as mpv.
2023-03-15 17:33:16 +01:00
Isaac Freund
a679743fa0
Cursor: lock to current geometry during move/resize
This eliminates cursor jitter entirely during interactive resize.

This also fixes a bug where the xdg-toplevel resizing state was not
cleared if a resize operation was aborted due to a change in view tags
or similar.
2023-03-14 13:34:55 +01:00
Isaac Freund
9db41115a8
XdgToplevel: ensure view dimensions match geometry
Some clients (e.g. mpv) do not respond to configures by committing
buffers of the exact size requested. Instead they may commit a buffer of
a smaller size in order to maintain an aspect ratio or not commit a
buffer at all.
2023-03-14 12:30:53 +01:00
Isaac Freund
90f240355e
Cursor: fix warp on output change with no views 2023-03-14 12:07:14 +01:00
Isaac Freund
0ba65848a1
Root: separate fallback list to handle 0 outputs
Mixing views that are currently being mapped/unmapped with views that
are stashed during hotplug down to 0 outputs is error-prone and almost
certainly has a bug or two hiding currently.
2023-03-14 11:53:04 +01:00
Isaac Freund
95825b0153
Root: remove incorrect assertions in addOutput() 2023-03-14 11:41:02 +01:00
Isaac Freund
dd542b5284
Output: reinitialize output_status, cleanup
If a output is removed and added back without being destroyed this must
be reinitialized.

This commit also cleans up the Root.applyPending() calls related to
output hotplug and adds some more logging.
2023-03-14 11:39:10 +01:00
Isaac Freund
0355b654af
doc: fix typo in riverctl man page 2023-03-13 10:04:46 +01:00
Isaac Freund
e4e8eae0df
example/init: update for rules system 2023-03-12 17:26:44 +01:00
Isaac Freund
fe3c3b5246
docs: fix typo in riverctl man page 2023-03-12 17:14:57 +01:00
Isaac Freund
b2b2c9ed13
river: add rules system
This is a breaking change and replaces the previous
csd-filter-add/remove and float-filter-add/remove commands.

See the riverctl(1) man page for documentation on the new system.
2023-03-12 16:44:19 +01:00
Isaac Freund
05eac54b07
xdg-decoration: clean up implementation
We now send some protocol errors that wlroots 0.16 is missing [1].
This also allows us to access the xdg decoration from a view, which will
be necessary for some future changes.

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4051
2023-03-10 18:49:30 +01:00