Commit Graph

1224 Commits

Author SHA1 Message Date
Isaac Freund
472f882f42
Output: inline renderOutput function
Having this in a separate file no longer makes sense since the switch to
the scene graph.
2023-03-01 11:32:04 +01:00
Isaac Freund
6411c71151
Root: centralize focus(null) calls in applyPending() 2023-03-01 10:49:44 +01:00
Isaac Freund
07154720fa
csd-filter-add/remove: add missing applyPending()
A transaction is now necessary to update border state.
2023-02-28 23:00:02 +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
0e0b585c44
xdg-shell: implement version 5 2023-02-28 14:55:58 +01:00
Isaac Freund
879b880a6a
XdgPopup: reimplement using the scene graph
xdg-shell version 3 is now implemented, supporting popup repositioning.
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
85843dd5c7
View: remove dead code
wl_output.enter/leave is handled by wlr_scene now.
2023-02-28 14:55:58 +01:00
Isaac Freund
1b57fe0aa7
Xwayland: create scene tree 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
Isaac Freund
4f0ce8fceb
render: use wlr_scene to render views 2023-02-28 14:55:58 +01:00
Isaac Freund
07294057cb
wlr-foreign-toplevel-management: remove protocol
This can be re implemented after the migration to the scene graph is
complete.
2023-02-28 14:55:58 +01:00
Isaac Freund
168756cbe8
render: remove damage tracking
This will be handled by wlr_scene shortly.
2023-02-28 14:55:58 +01:00
Isaac Freund
b7ac5becfb
pointer-constraints: remove protocol
This implementation as it stands is incomplete/buggy and will make
updating to wlr_scene more complex.

It will be reimplemented after updating to wlr_scene is complete.
2023-02-28 14:55:58 +01:00
Isaac Freund
06cb76f937
Keyboard: fix keyboard-layout mapping crash 2023-02-28 14:40:10 +01:00
Isaac Freund
c0c08ab919
deps: update to latest zig-wayland/zig-wlroots 2023-02-27 17:51:31 +01:00
Isaac Freund
0ccf0e65d5
deps: update to latest zig-wayland/zig-wlroots 2023-02-27 13:35:55 +01:00
Isaac Freund
e1ab51f260
Seat: guard setFocusRaw() usage while locked
Focusing a layer shell or Xwayland override redirect surface while
locked is a bug.
2023-02-10 13:15:16 +01:00
Isaac Freund
919d5d7c62
docs: remove repology badge from readme
It's getting too big and has too much redundant information.
2023-02-03 18:27:38 +01:00
Isaac Freund
345d6b737a
docs: fix typos in riverctl man page 2023-02-03 18:18:21 +01:00
Isaac Freund
5274383c72
wlr-output-management: fix bug due to zig miscompilation
It looks like having the empty error capture |_| on the else branch of
the if statement causes the else branch to be ignored by the compiler.

This should be a compile error, as the condition of the if statement is
a bool, not an error union.
2023-01-30 23:48:24 +01:00
Isaac Freund
76952183c0
session-lock: fix assertion failure on hot-plug while locked 2023-01-25 12:39:00 +01:00
Isaac Freund
946173005d
wlr-output-management: leverage new wlroots APIs
These new functions allow testing commits without messing up the
pending state of the output and needing to rollback. The new apply()
function also makes the code considerably more concise.
2023-01-24 13:55:40 +01:00
Alexander Courtis
4c6f47669b
wlr-output-management: apply adaptive sync state 2023-01-24 11:18:27 +01:00
Isaac Freund
a9bfb7c924
idle-inhibit: fix use-after-free
A user reported a crash that only reproduces when preloading a hardened
malloc implementation. From the stack trace, this use-after-free seems
to be the most likely cause. Yay hardened malloc!
2023-01-21 14:54:14 +01:00
Isaac Freund
6c7586e8d7
session-lock: properly handle disabled outputs
Outputs that are part of the layout but currently disabled (e.g. due
to use of wlr-output-power-management) are not correctly handled as
river currently waits for them to present a new locked frame before
sending the locked event.

This new frame never comes however since the output is disabled. Fix
this by maintaining the correct Output.lock_render_state as outputs
are enabled/disabled.

Additionally add missing maybeLock() calls to handle the case that all
outputs in the layout are disabled.
2023-01-18 12:31:07 +01:00
Hugo Machet
8a3530b8a3
View: fix pointer comparison in notifyTitle()
Curently since the struct is semantically passed by value not reference,
there is no guarantee that the `seat_node.data.focused.view == &self`
comparison will work as intended. Since updating to Zig 0.10.0, it seems
this latent bug has now manifested and the focused view title is no
longer sent to the client when it changes.

Fix this by taking the view argument by constant pointer instead.
2023-01-13 14:03:17 +01:00
Zakariyya Von Forslun
6fdfb7134f Cursor: fix incorrect lock manager state assertion 2023-01-13 11:14:30 +01:00
Isaac Freund
84abdfaced
command/layout: fix a memory leak 2023-01-12 15:35:31 +01:00
Isaac Freund
615beab2e6
Seat: rework Xwayland Override Redirect focus
Instead of stashing the active view and setting Seat.focused to the
Xwayland OR surface when a child OR surface of a currently focused
Xwayland view is given keyboard focus, keep Seat.focused set to the
Xwayland view.

Such Override Redirect surfaces are commonly used for drop down menus
and the like, and river should behave as if the parent Xwayland view
still has focus.

This ensures that the riverctl focus-view next/prev commands continue to
work as expected while a popup is open, the correct focused view title
will be sent over river status, etc.

It's also cleaner to centralize this logic in XwaylandOverrideRedirect
and keep it out of Seat.zig.
2023-01-12 14:44:55 +01:00
Zakariyya Von Forslun
63610d9440 Seat: keep parent Xwayland view of a focused OR surface activated
Xwayland OR menus may disappear if their parent view is deactivated. The
heuristic and ICCCM input model implemented prior, used to determine whether an
OR surface may take focus, does not cover all menus, so retaining parent view
activation works as a catch-all solution for handling unwanted OR menu focus.
2023-01-12 06:56:11 +10:00
Isaac Freund
f20692e329
deps: update zig-wayland to fix build on aarch64 2023-01-09 14:55:18 +01:00
Isaac Freund
2c0c606596
flags: further cleanup after Zig 0.10
Long live the self hosted compiler!
2023-01-08 17:01:14 +01:00
Isaac Freund
09f3f141ae
deps: update to Zig 0.10 2023-01-08 16:21:42 +01:00
Isaac Freund
f370202b68
render: fix rounding for fractional scaling
We currently scale the width/height of rectangles based on the scaled
x/y instead of the unscaled x/y. This however leads to inconsistent
width/height due to rounding. Fix this bug by basing width/height
scaling off of the original x/y.

Furthermore, fix a typo where we scaled the height off of the x
coordinate instead of the y coordinate.
2023-01-08 15:25:16 +01:00
Isaac Freund
4dd02358d9
session-lock: fix assertion failure on abnormal client behavior
If the client commits a protocol error or otherwise crashes before the
session has been fully locked, we currently try to send the locked event
without checking if the client has been destroyed.

This commit adds the necessary if statement.
2023-01-07 17:35:22 +01:00
Isaac Freund
f511a34ded
session-lock: fix assertion failure due to race
There's currently a potential race in the implementation that can be hit
during unlocking. This is not a security vulnerability, but it does
cause the compositor to crash due to a failed assertion.

This commit simplifies the code and fixes the race as well as tightening
up the assertions around this state/control flow even further.
2023-01-07 14:58:28 +01:00
Isaac Freund
df2fc30238
session-lock: wait for present before locking
Currently we send the locked event after rendering and commit of blank
or lock surfaces buffers on all outputs. However, this is technically
not enough to ensure that the buffers have been presented.

Instead, listen to the wlr_output present event to ensure that no
normal, "unlocked" content is possibly visible.
2023-01-06 18:51:40 +01:00
Isaac Freund
c479525ab8
rivertile: fix code to disallow 0 main count
Also document this limit
2023-01-06 17:47:54 +01:00
MaxVerevkin
030f7efd4f
render: premultiply alpha for user-provided colors
The wlroots rendering API expects colors to be provided with
premultipled alpha but we currently do not parse them as such. This
causes blending with e.g. a transparent border color to be very broken.
2023-01-06 17:14:52 +01:00
Leon Henrik Plickat
701d16c2ea
completions: add keyboard-layout 2023-01-06 16:36:00 +01:00