Commit Graph

121 Commits

Author SHA1 Message Date
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
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
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
bf759c7c57
View: clamp to output on exiting float/fullscreen 2023-03-01 17:13:14 +01:00
Isaac Freund
50513390ce
View: move borders state to State struct
This state affects rendering, so it should pass through the transaction
system like the rest.
2023-03-01 16:12:27 +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
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
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
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
a545a06c5b
View: implement borders with 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
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
Isaac Freund
09f3f141ae
deps: update to Zig 0.10 2023-01-08 16:21:42 +01:00
Isaac Freund
39104ae9e3
command/spawn-tagmask: apply globally
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.
2023-01-02 00:58:25 +01:00
Isaac Freund
096e175cec
View: honor fullscreen requests before map 2022-12-24 03:06:53 +01:00
Isaac Freund
489a49735a
river: update to wlroots 0.16 2022-11-13 16:16:07 +01:00
Leon Henrik Plickat
765a3f4aff river: keep floating views within bounds when sending to output 2022-08-11 15:22:07 +02:00
Isaac Freund
7402cb8aea
deps: update to latest zig-wlroots
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.
2022-07-01 20:53:45 +02:00
Isaac Freund
db366e9455
Xwayland: fix View.fromWlrSurface for OR surfaces 2022-06-24 12:05:54 +02:00
Isaac Freund
960afa89ec
View: refactor initialization
This anytype parameter is a wart that's been around for far too long.
2022-05-29 16:28:12 +02:00
Isaac Freund
6ef97eea24
Xwayland: handle override redirect state changes 2022-05-29 16:28:07 +02:00
dfangx
d5c915e3cb
idle-inhibit: implement protocol 2022-05-11 14:14:01 +02:00
tiosgz
81ba188df0 view: stop enforcing custom minimum size
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.
2022-03-02 20:14:27 +00:00
Isaac Freund
147d9c2f90
View: use last set fullscreen state in applyPending()
This avoids a race where the fullscreen set is e.g. set then unset
before the transaction has been completed and the current state has
been updated.
2022-02-05 00:08:21 +01:00
Isaac Freund
be870e058d
View: fix/simplify logic in applyPending()
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.
2022-02-03 21:23:02 +01:00
Isaac Freund
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
Isaac Freund
c1d985ac29
build: update to zig version 0.9.0 2021-12-24 05:28:14 +00:00
Isaac Freund
c84fd1a936
View: send enter/leave events to full surface tree 2021-10-20 14:11:19 +02:00
Isaac Freund
4b94b9c083
Xwayland: honor fullscreen requests 2021-10-12 18:47:08 +02:00
Isaac Freund
9270a2df08
View: fix unmap/destroy control flow
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.
2021-10-02 14:48:22 +02:00
Isaac Freund
fd70a93c67
View: add fullscreen check missing in previous commit 2021-10-02 12:05:24 +02:00
Isaac Freund
e6bb373240
View: resize if moved between outputs while fullscreen 2021-09-30 17:17:46 +02:00
Isaac Freund
b8ebbc29cf
xdg-toplevel: fix configure serial checking
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.
2021-09-18 18:45:30 +02:00
Isaac Freund
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
novakane
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
Isaac Freund
1baf3bf462
seat: always add view to focus stack on map
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.
2021-08-10 21:54:36 +02:00
Isaac Freund
bbfd0c334c
view: arrange when exiting fullscreen to layout
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.
2021-07-25 22:30:47 +02:00
Isaac Freund
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
Isaac Freund
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
Isaac Freund
3c951fed74
view: fix typo causing UB on resizing xwayland views 2021-07-14 23:51:49 +02:00
Isaac Freund
d413db9227
xdg-shell: set resizing state during interactive resize 2021-07-14 15:32:24 +02:00
Isaac Freund
a2c81adba0
xdg-toplevel: remove listeners before view destroy
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().
2021-06-17 20:57:14 +00:00
novakane
2e7c1dbe6a config: make attach-mode global 2021-06-08 18:26:36 +00:00