Commit Graph

61 Commits

Author SHA1 Message Date
09f3f141ae deps: update to Zig 0.10 2023-01-08 16:21:42 +01:00
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
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
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
a7f00a77ca touch: support drag and drop 2022-12-30 23:20:18 +01:00
8f8d94aa45 session-lock: fix potential race
Currently the session lock client has no 100% safe way to know when it
is safe to suspend after requesting that the session be locked.

For a suspend to be safe the compositor must have either blanked or
rendered a lock surface on all outputs before suspending. This is
because the current framebuffer on suspend appears to be saved and
displayed again after suspend, at least on my Linux system.

If a new "locked" frame for all outputs is not rendered before suspend,
an "unlocked" frame or frames will likely be briefly displayed on resume
before the lock surfaces are rendered or the screen is blanked.

To fix this, wait until a lock surface has been rendered on all outputs,
or if that times out until all outputs have been blanked, before sending
the locked event to the client.

Resolving this race on the compositor side without protocol changes
is the most effective way to avoid this potential information leak,
regardless of which session lock client is used.
2022-12-29 18:25:12 +01:00
49efbfe046 session-lock: handle output unplugging better 2022-11-13 16:45:18 +01:00
33187e0b09 ext-session-lock: implement protocol 2022-11-13 16:45:18 +01:00
489a49735a river: update to wlroots 0.16 2022-11-13 16:16:07 +01:00
03e8da669c Xwayland: Rename XwaylandUnmanaged to XwaylandOverrideRedirect 2022-05-30 01:08:09 +02:00
da59632cea code: Cleanup use of std library for consistancy 2022-02-08 12:02:05 +01:00
79d7775a3d code: relicense to GPL-3.0-only
I don't need anyone's permission to make this change since
GPL-3.0-or-later is one-way compatible with GPL-3.0-only.
2022-01-31 19:33:22 +01:00
c1d985ac29 build: update to zig version 0.9.0 2021-12-24 05:28:14 +00:00
4d19621f1e river: update to wlroots 0.15.0 2021-12-21 03:18:30 +00:00
98aed8d47e river: fix viewporter protocol implementation
It turns out that wlroots requires us to do a bit more than just create
the wlr_viewporter. Docs are being added to the wlroots header in
https://github.com/swaywm/wlroots/pull/3171
2021-09-06 19:03:17 +02:00
e59c2a73d7 river: implement xdg-activation-v1
- add a new "urgent" border color
- add a new event to river-status-unstable-v1

Co-authored-by: Isaac Freund <ifreund@ifreund.xyz>
2021-08-19 12:58:52 +00:00
556d790694 render: draw borders before rendering views
Menus, tooltips, etc. can extend beyond a view's borders.  Render views
after their borders so floating content appears on top.

Unfocused floating content can still be obscured by views higher in the
stack and the focused view.
2021-08-07 10:18:52 +00:00
f62eedb048 render: sync with Cursor.surfaceAt(), draw all view popups
This was slightly out of sync with Cursor.surfaceAt() which did not
fullscreen or xwayland unmanaged views properly. Also simplify things
and improve correctness by always rendering all xdg popups. A view
losing focus does not always mean that all popups will be destroyed.
2021-07-23 15:42:47 +02:00
96e1082156 river: remove opacity command
This code is complex and increases maintenance burden but doesn't
add any functionality, only eye-candy.

Futhermore, neither I nor any of the core contributors use it.

There may be a place in river for such eye-candy down the line, in which
case this code could be revived. Currently river is early enough in its
development that our focus should be on core functionality instead.
2021-07-20 08:47:02 +00:00
39578db134 render: @panic() if CLOCK_MONOTONIC is not supported
Making this unreachable and invoking illegal behavior is incorrect.
2021-06-27 13:20:36 +02:00
c0a2286847 code: update to zig 0.8.0 2021-06-05 17:29:58 +00:00
13f01bcb4b render: do basic yes/no damage tracking 2021-05-24 16:43:21 +02:00
ac27db236a river: remove Output.root
The server is now global so this is no longer needed.
2021-05-13 14:35:36 +02:00
89e0d4c083 river: remove Root.server
The server is now global so this is no longer needed.
2021-05-13 14:26:27 +02:00
7ccb4794c9 river: always render floating views above layout views 2021-05-05 15:54:52 +02:00
9e3e92050e river: update for wlroots 0.13.0 2021-04-08 00:21:17 +02:00
3c1f1df0c0 render: don't schedule new frame on output commit failure
This reverts commit c457b12cf3.

This attempted workaround seems to work fine if the output commit only
fails with EBUSY, but enters an infinite loop otherwise.
2021-03-28 13:55:22 +02:00
Qiu
c457b12cf3 render: schedule new frame on output commit failure
This seems to fix issues with rendering freezing described in
https://github.com/ifreund/river/issues/153.
2021-03-27 16:17:24 +01:00
98d51f6d24 Use std.log instead of log.zig 2021-02-08 18:35:11 +01:00
a672738603 render: iterate subsurfaces of popups manually
wlr_xdg_surface_for_each_popup() fails to do this and
wlr_xdg_surface_for_each_popup_surface() is not yet merged, so implement
a workaround for now.
2021-01-07 16:11:48 +01:00
751b63f6fa render: pass Output by constant pointer
This is semantically what we want as we store a pointer to the output in
the SurfaceRenderData struct.
2021-01-06 17:53:04 +01:00
b73cb7bb69 render: draw popups over borders 2021-01-05 20:05:35 +01:00
20d804cdb5 code: switch to custom wlroots/libwayland bindings
This is a big step up over @cImport() for ergonomics and type safety.
Nearly all void pointer casts have been eliminated!
2020-12-13 22:53:33 +01:00
b2b1a1f5e1 render: remove unnecessary call to wlr_output_effective_resolution 2020-12-12 16:35:33 +01:00
4b7246685f code: Fix render call width and height 2020-12-07 11:47:55 +01:00
dae6c06e0c screencopy: add workaround for wlroots bug
Currently screencopy's copy_with_damage request is broken for
compositors not submitting damage. As a workaround simply damage
the whole output each frame.
2020-12-05 01:10:06 +01:00
f80992e329 meta: make copyright headers more maintainable
- list all files as copyright "The River Developers"
- add an AUTHORS file to acknowledge contributors
2020-11-11 20:33:43 +01:00
77d3eb1bf0 layer-shell: render all popups over top layer
This means the popups belonging to e.g. a surface in the background
layer will be rendered over views.
2020-11-10 12:12:56 +01:00
30b1675fe8 render: Print a log message when wlr_output_commit fails 2020-10-31 19:11:22 +01:00
b67ea748a3 Implement configurable view opacity with fade effect 2020-10-05 23:03:57 +02:00
f597e7da63 seat: implement drag and drop 2020-09-14 20:11:25 +02:00
db416eb119 view stack: rework iteration for flexibility
There is now a single iter() function which accepts a filter and context
allowing users of the api to filter the views in any arbitrary way. This
change allowed for a good amount of code cleanup, and this commit also
ensures that the correct properties are checked in each case, including
the new View.destroying field added in the previous commit. This fixes
at least one crash involving switching focus to a destroying view.
2020-08-21 16:31:39 +02:00
96a91fd2f7 view: double buffer focus, use counter not bool
- Double buffering focus state ensures that border color is kept in sync
with the transaction state of views in the layout.
- Using a counter instead of a bool will allow for proper handling of
multiple seats. This is done in the same commit to avoid more churn in
the future.
2020-08-03 18:54:18 +02:00
0ebb5ccc17 code: update to wlroots 0.11.0 2020-07-16 21:20:43 +02:00
be29b0ef95 Implement csd_filter list 2020-07-16 17:08:19 +02:00
86386e84bc output: introduce state struct
This simplifies the handling of the current/pending tags and will be
used in the future for atomic layout updates involving layer surface
exclusive zones.
2020-07-02 21:56:26 +02:00
7b6e05005d render: draw fullscreen views properly
- use a solid black background
- only draw the overlay layer
2020-06-29 01:46:24 +02:00
82a444a7c0 view: use saved geometry for borders if needed
This fixes the issues caused by 60f06a1 and greatly simplifies the code.
Turns out we were already tracking the dimensions needed.
2020-06-28 20:45:17 +02:00
60f06a1a40 view: draw borders around actual dimensions
Previously if the view did not take the size requested, we would draw
the borders around the size we asked the view to take rather than its
actual size.
2020-06-28 01:46:53 +02:00
c04112b81a view: introduce state struct to simplify code
The state struct holds all of the state that is double-buffered and
applied through transactions. This more explicit handling simplifies
much of the code, and will allow for easier implementation of new
feature such as fullscreen.
2020-06-27 23:18:41 +02:00