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.
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.
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.
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.
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
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.
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.
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.
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.
Currently screencopy's copy_with_damage request is broken for
compositors not submitting damage. As a workaround simply damage
the whole output each frame.
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.
- 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.
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.
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.
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.