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.
- 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.
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.
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.
Currently the spawn-tagmask applies to the currently focused output.
This however means that it is lost if the monitor is unplugged and makes
it hard to set for all outputs.
Change this to make the command apply to all outputs.
This is a breaking change.
This fixes the return type of Foo.fromWlrSurface() functions which can
in fact return null in the edge case that the role matches but the
corresponding object has already been destroyed.
I have encountered a crash (failing assert) if a view specified a fixed
size less than this minimum, and according to ifreund this behavior was
planned to be removed, anyway.
In particular, this fixes a crash that can happen if a client is made
non-fullscreen and then, while that transaction is ongoing, made
fullscreen again.
Currently the view destruction sequence is started as soon as a view
is unmapped. However, this is incorrect as a client may map the view
again instead of destroying it.
Instead, only start the view destruction sequence when the underlying
xdg toplevel or xwayland surface is destroyed.
Currently if another configure is in flight after the one we are
tracking the serial of and the client acks the second configure as well
(or only the second configure) before committing, we will never realize
the configure we are tracking has been acked.
Instead, listen for the ack_configure signal and set a bool that we can
check on surface commit.
This probably isn't an issue that would actually be hit by well behaved
clients as river doesn't send redundant configure events. However,
having correct code is always better even if it's slightly more complex.
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
Currently if a view is mapped while some other view is fullscreen, it
will not be added to the focus stack, which means that if the fullscreen
view is then closed the view which was not added to the focus stack will
not be focused.
To fix this, always add views to the focus stack on map.
This arrange is actually required because the post_fullscreen box might
not hold the correct dimensions if the view was made fullscreen while
a transaction was already in progress.
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.
Currently in handleUnmap() we call View.unmap() before removing
listeners. However View.unmap() may destroy the view before returning
if the transaction started doesn't have to wait on any configures.
To ensure that we don't try to remove listeners which have already been
free'd, do this before calling View.unmap().