Commit Graph

136 Commits

Author SHA1 Message Date
Isaac Freund
a531311ac6
XdgToplevel: handle configure timeout gracefully
Currently configure timeouts hit the "client is buggy and initiated size
change while tiled or fullscreen" code path even if the client is not in
fact buggy. This causes state to get out of sync between river and the
client, and is highly visible as the borders drawn by river no longer
align with the buffer dimensions committed by the client.

This commit fixes this by tracking acks/commits in response to
configures even after a timeout and properly integrating them with the
transaction system.
2024-02-13 14:50:58 +01:00
Isaac Freund
6e9bd83e1d
Root: use Output.PendingState for fallback
Using the same type for these has the potential to simplify some future
code.
2024-01-12 16:49:04 -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
9aa0f1a9a6
Output: fix possible crash on destroy 2024-01-05 12:50:36 -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
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
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
7ee6c79b6b
build: update to wlroots 0.17 2023-12-01 17:29:05 +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
Isaac Freund
2e586c7061
build: update to Zig 0.11.0 2023-10-16 16:27:03 +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
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
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
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
Isaac Freund
b7b371cb4f
pointer-constraints: implement protocol
Now with 50% less pointer warping!

The new implementation requires the user to move the cursor into the
constraint region before the constraint is activated in order to keep
behavior more predictable.
2023-03-05 23:11:54 +01:00
Isaac Freund
cc2b38af92
presentation-time: support protocol 2023-03-04 23:06:41 +01:00
Isaac Freund
44004e2d28
SceneNodeData: allow access from wlr_surfaces
This replaces the old View.fromWlrSurface function and is more general.

This commit also moves the xdg activation request_activate listener to
Server as it has no reason to be in View.
2023-03-04 22:41:35 +01:00
Isaac Freund
ea4e589fdc
river: clean up some uneeded TODOs 2023-03-04 20:58:02 +01:00
Isaac Freund
b4ae62cd40
View: rework configure abstraction
- Move the decision whether a configure should be tracked or not into
the xdg toplevel/xwayland code.

- Only track configures for xdg toplevels with the transaction system
if the dimensions of the view are affected.
2023-03-04 16:03:16 +01:00
Isaac Freund
0be43ad45f
Root: keep all fullscreen views the correct size
Currently we may resize fullscreen views when they become visible/not
visible when switching tags even if their fullscreen state remains
constant. This is suboptimal, and as it turns out also much more complex
to implement.
2023-03-03 13:40:44 +01:00
Isaac Freund
9bfa0ece23
View: handle destroy during inflight layout demand 2023-03-02 16:42:16 +01:00
Isaac Freund
686ef11fc8
river: render floating views above the layout 2023-03-02 15:10:10 +01:00
Isaac Freund
83fe764fcd
View: only send configures through transactions
This reduces the number of separate configure events sent to clients
through better batching and is also more correct.
2023-03-01 20:44:13 +01:00
Isaac Freund
ed0aa73670
Output: fix background of transformed outputs 2023-03-01 19:40:37 +01:00
Isaac Freund
b1540e2d94
Root: fix use of view.current before update
In commitTransaction() we currently the current view state to determine
whether or not to enable the view's scene tree. However we don't update
the view's current state until after that check.
2023-03-01 19:03:16 +01:00
Isaac Freund
bf759c7c57
View: clamp to output on exiting float/fullscreen 2023-03-01 17:13:14 +01:00
Isaac Freund
c1c72e23a3
Root: fix more fullscreen bugs
Moving fullscreen views between outputs now works properly.
A case in which we did not inform the client that it is no longer
fullscreen has been fixed as well.
2023-03-01 12:16:53 +01:00
Isaac Freund
6411c71151
Root: centralize focus(null) calls in applyPending() 2023-03-01 10:49:44 +01:00
Isaac Freund
8cb5ca9041
river: fix various fullscreen related bugs 2023-02-28 22:56:12 +01:00
Isaac Freund
e11d4dc0de
LayerSurface: fix use-after-free on destroy
The scene_layer_surface may be destroyed before handleDestroy is called,
which means we can't rely on it to access the wlr_layer_surface in
destroyPopups().
2023-02-28 18:28:17 +01:00
Isaac Freund
005bde367c
OutputStatus: rework implementation
This was motivated by the view tags not being proplerly updated by
Root.commitTransaction() when there were no views on an output.
2023-02-28 18:28:17 +01:00
Isaac Freund
be4330288d
river: rework core data structures & transactions 2023-02-28 18:28:17 +01:00
Isaac Freund
f5dc67cfc1
View: use saved surface trees for transactions 2023-02-28 14:55:59 +01:00
Isaac Freund
ce7fda4ed9
Xwayland: render using the scene graph 2023-02-28 14:55:59 +01:00
Isaac Freund
0b2272ec57
DragIcon: render using the scene graph 2023-02-28 14:55:58 +01:00
Isaac Freund
dbcb75dddb
LayerSurface: render using the scene graph
This also brings a lot of code cleanup and proper support for
version 4 of the protocol.
2023-02-28 14:55:58 +01:00
Isaac Freund
a545a06c5b
View: implement borders with scene graph 2023-02-28 14:55:58 +01:00
Isaac Freund
f4a8d6dcc9
Output: use separate scene trees for layers 2023-02-28 14:55:58 +01:00
Isaac Freund
b38676f078
session-lock: use the scene graph 2023-02-28 14:55:58 +01:00
Isaac Freund
683ed0f04e
Cursor: remove surfaceAt()
We now use the wlr_scene API to find out what is at the cursor location.
2023-02-28 14:55:58 +01:00