Commit Graph

136 Commits

Author SHA1 Message Date
Isaac Freund
4f0ce8fceb
render: use wlr_scene to render views 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
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
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
09f3f141ae
deps: update to Zig 0.10 2023-01-08 16:21:42 +01:00
Isaac Freund
a7f00a77ca
touch: support drag and drop 2022-12-30 23:20:18 +01:00
tiosgz
49efbfe046
session-lock: handle output unplugging better 2022-11-13 16:45:18 +01:00
Isaac Freund
489a49735a
river: update to wlroots 0.16 2022-11-13 16:16:07 +01:00
Isaac Freund
7d9d889226
deps: update to latest zig-wlroots
This fixes a nasty ABI bug that could cause river to crash when
hotplugging down to 0 outputs.
2022-06-23 18:50:00 +02:00
Isaac Freund
03e8da669c
Xwayland: Rename XwaylandUnmanaged to XwaylandOverrideRedirect 2022-05-30 01:08:09 +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
Hugo Machet
da59632cea code: Cleanup use of std library for consistancy 2022-02-08 12:02:05 +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
1e3ea826c0
wlr-output-management: simplify implementation
Notably, we no longer call both wlr_output_test and wlr_output_commit
when applying an output config, which seems to fix or workaround an
occasional crash since updating to wlroots 0.15.0.
2022-01-28 23:28:00 +01:00
Isaac Freund
c1d985ac29
build: update to zig version 0.9.0 2021-12-24 05:28:14 +00:00
Isaac Freund
6a093fecee
river: remove wlroots 0.14 workarounds
Since updating to wlroots 0.15 we can remove several workarounds we had
in place due to wlroots improvements.
2021-12-22 20:15:57 +00:00
Isaac Freund
4d19621f1e
river: update to wlroots 0.15.0 2021-12-21 03:18:30 +00: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
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
6e51a8fcdd
river-status: fix output status destruction
There was a use-after-free if the Output was destroyed first, and the
memory of the output status was leaked.
2021-08-12 22:38:08 +02:00
Isaac Freund
d4c249a5cb
output: simplify layer shell handling on destroy
No need for noop output hacks here, wlr.LayerSurfaceV1.close()
synchronously emits the unmap signal if the layer surface is mapped.
2021-08-12 21:58:17 +02:00
Isaac Freund
9e70fb25a5
output: fix debug log on tag change 2021-07-28 13:44:23 +02:00
Isaac Freund
53dd3875b3
cursor: avoid sending unnecessary pointer motion events
If the current Cursor.maybeResetState() function is called while in
passthrough mode, it will send a pointer motion event. This is
unnecessary as we have already sent the same pointer motion event at
least once.

Also refactor the code slightly and improve naming.
2021-07-23 19:18:49 +02:00
Isaac Freund
36ce81bb67
cursor: add missing maybeResetState() callsite
This function needs to be called whenever pending state is made current,
which includes when views not tracked by the transaction system commit.
2021-07-23 18:37:24 +02:00
Leon Henrik Plickat
a3c6571326 cursor: reset state if needed on transaction commit
A transaction may move the current target of a cursor action to a
non-visible tag, make it fullscreen, or otherwise change things such
that the current cursor state no longer makes sense.

To handle this, check if we should reset cursor state every time a
transaction is committed.
2021-07-23 11:48:01 +00: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
Alexander Taylor
1fec079266 Fix typo s/ouput/output/ in function name 2021-07-19 12:01:10 +00:00
Isaac Freund
3efcfedcf4
layer-shell: handle commits before map
A client is free to change its mind and request a different
size/anchor/etc after recieving the initial configure but before
attaching and committing the first buffer. This means that we should
respond to such a situation with a new configure.

mako has been observed doing this in the wild for example.
2021-06-22 14:07:14 +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
Isaac Freund
20eb94317a
root: simplify noop output handling
Instead of removing the listeners of the noop output early, simply never
add them.
2021-06-14 21:52:44 +00:00
Isaac Freund
88410cc2b8
output: destroy Layouts on Output removal
The Layout struct holds a pointer to the Output which becomes invalid
when the Output is destroyed so we must ensure all the layouts of an
Output are destroyed first.
2021-06-09 20:03:19 +00:00
Isaac Freund
68267a4cfe
river: don't extend timeout on transaction preemption
This avoids locking up the compositor if a client is unresponsive and
the user continuously initiates new transactions through their actions.
2021-06-08 15:18:45 +00:00
Isaac Freund
021fd8f376
code: remove now unnecessary zig fmt directives
zig fmt does what we want since zig 0.8.0
2021-06-08 03:20:56 +00:00
Isaac Freund
c0a2286847
code: update to zig 0.8.0 2021-06-05 17:29:58 +00:00
Isaac Freund
13f01bcb4b render: do basic yes/no damage tracking 2021-05-24 16:43:21 +02:00
Isaac Freund
ac27db236a
river: remove Output.root
The server is now global so this is no longer needed.
2021-05-13 14:35:36 +02:00
Isaac Freund
89e0d4c083
river: remove Root.server
The server is now global so this is no longer needed.
2021-05-13 14:26:27 +02:00
Isaac Freund
e80b883a47 river-layout: update to v2
This implements the changes to the river-layout protocol proposed
in the previous commit removing river-options.
2021-04-27 00:10:20 +02:00
Leon Henrik Plickat
f72656b72e river-layout: create and implement protocol
Replace the current layout mechanism based on passing args to a child
process and parsing it's stdout with a new wayland protocol. This much
more robust and allows for more featureful layout generators.

Co-authored-by: Isaac Freund <ifreund@ifreund.xyz>
2021-04-20 18:27:03 +02:00
Isaac Freund
9e3e92050e
river: update for wlroots 0.13.0 2021-04-08 00:21:17 +02:00
foxfromabyss
98d51f6d24 Use std.log instead of log.zig 2021-02-08 18:35:11 +01:00
Isaac Freund
cc08be2dee
code: clean up listener initialization 2020-12-31 15:35:35 +01:00
Isaac Freund
ac20f5aa1d
root: improve handling of 0 -> 1 output transition
Recover more gracefully from being hotplugged down to 0 outputs and then
gaining a new one. Move all views to the new output and restore the
focused output tags of the last output to be removed.
2020-12-30 13:19:40 +01:00
Isaac Freund
a098bbe03a
root: stop tracking xwayland views in transactions
Frame perfection for xwayland views would require too much complexity
to support and would bleed all over the codebase.
2020-12-29 20:38:30 +01:00
Isaac Freund
3438c05332
root: merge in OutputManager
These two files were primarily dealing with the same things. Merging
them removes some indirection from the code and keeps things simpler.
2020-12-27 15:24:20 +01:00
Isaac Freund
386316bdbd
output: get rid of active field
The less state that needs to be maintained, the better
2020-12-21 16:19:44 +01:00
Isaac Freund
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
Marten Ringwelski
10373da634 code: Add Root.removeOutput 2020-12-07 11:47:55 +01:00
Marten Ringwelski
fc549d6249 code: Refactor Root.addOutput 2020-12-07 11:47:55 +01:00
Isaac Freund
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
Marten Ringwelski
d23b8a7f27 code: Move wlr_output_layout_add from Output.init to Root.addOutput 2020-11-02 14:08:00 +01:00
Marten Ringwelski
1bd6f6bed1 code: Remove most of the hack around @cImport and flexible arrays 2020-10-30 15:23:52 +01:00
Leon Henrik Plickat
b67ea748a3 Implement configurable view opacity with fade effect 2020-10-05 23:03:57 +02:00
Isaac Freund
27b666dbba
code: update to zig master in prep for 0.7.0
This commit makes the minimal necessary changes to get things working,
there are further changes which can be made to take advantage of new
features.
2020-10-02 20:34:24 +02:00
Isaac Freund
f597e7da63
seat: implement drag and drop 2020-09-14 20:11:25 +02:00
Isaac Freund
dd425a3e66
root: clean up initialization 2020-08-21 21:06:59 +02:00
Isaac Freund
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
Isaac Freund
fa08d85c58 view: implement frame-perfect destroy
river's View objects may now outlive their wlroots counterparts so that
we can continue to render a destroyed view until the transaction is
completed.
2020-08-21 16:31:39 +02:00
Isaac Freund
7a6ac8eb6e seat: set focus before starting transactions
Focus was made double-buffered in 96a91fd. However, much of the code
still behaved as if focus was separate from the transaction system.
This commit completes the work started in 96a91fd and ensures that
focus is applied consistently in a single transaction.
2020-08-13 11:17:15 +02:00
Isaac Freund
2669a615b6 root: refactor transaction initiation
- require the caller to use Root.startTransaction() directly
- introduce View.applyPending() to unify logic
- introduce View.shouldTrackConfigure() to unify more logic
- update all callsites to intelligently rearrange only what is necessary
2020-08-13 11:17:15 +02:00
Isaac Freund
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
Isaac Freund
56df9176b3
server: handle SIGINT/SIGTERM with wl_event_loop
This is cleaner than having a separate signal handler and should be more
consistent/reliable.
2020-08-01 17:27:49 +02:00
Isaac Freund
014963612c
river-status: fix bug sending old output tag state 2020-07-06 11:09:23 +02:00
Isaac Freund
341fe1e977
code: handle out of memory as well as possible 2020-07-05 22:49:17 +02:00
Isaac Freund
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
Isaac Freund
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
Isaac Freund
79bb0accac
code: improve error handling consistency 2020-06-26 00:59:31 +02:00
Isaac Freund
12d34d4ded
bikeshed: rename util.allocator to util.gpa
This is less typing and more clear. A definite win.
2020-06-19 14:32:30 +02:00
Isaac Freund
d74323bbbf
code: improve logging functions
this implements a modified version of the logging interface proposed
here: https://github.com/ziglang/zig/pull/5348
2020-06-17 01:31:38 +02:00
Isaac Freund
c5de1641dc
code: create util.allocator and use globally
river is not a library and passing a general purpose allocators around
everywhere does not make sense and leads to ugly code. This does not
prevent us from using local arenas if they are fitting.
2020-06-16 22:48:08 +02:00
Isaac Freund
fb8d855ec9
code: create voidCast() util function 2020-06-16 20:54:05 +02:00
Isaac Freund
48ea771310
transactions: save and render subsurface buffers 2020-06-09 23:13:14 +02:00
Isaac Freund
052c8e1dcb
transactions: handle preemption take 2
This implementation is far simpler than c0d7e71 as it takes advantage of
wlroots's tracking of pending state.

Additionally, we now send frame done events if a view that we are
configuring commits with the wrong dimensions. This is necessary in
order to trigger a redraw for some clients as well as being a more
correct implementation of the protocol.
2020-06-09 20:06:30 +02:00
Isaac Freund
24b1a566de
transactions: revert c0d7e71 2020-06-09 17:04:38 +02:00
Isaac Freund
7c094420ed
transactions: propogate x/y of new box if needed 2020-06-08 14:11:52 +02:00
Isaac Freund
5f2aa02132
transactions: set timeout back to 200ms
The change to 1000ms was an accident
2020-06-08 01:16:15 +02:00
Isaac Freund
c0d7e71ec4
transactions: handle preemption properly
when a transaction interrupts an ongoing transaction, we must be careful
to handle the configures properly. This commit adds a new member to view
so that we can store the dimensions sent with the last configure in
order to determine if the preempting transaction should override the
ongoing configure or not.

Additionally, some views do not ack a configure if they already have the
requested dimensions. This can happen if a pending configure setting
alternative dimensions is overridden, so in this case we do not wait for
an ack before committing the transaction.
2020-06-08 00:10:30 +02:00
Isaac Freund
7b1e07d3d5
code: remove dead code 2020-06-07 19:40:19 +02:00
Isaac Freund
a63fb461ba
river-status: send view_tags on view map/unmap 2020-06-05 00:24:46 +02:00
Isaac Freund
5aa7fe8af8
river-status: implement protocol 2020-06-04 16:56:58 +02:00
Isaac Freund
03fc51d8d6
Eliminate some magic numbers 2020-06-02 17:02:03 +02:00
Isaac Freund
9856bc92ec
Clean up some memory leaks 2020-06-02 13:45:56 +02:00
Isaac Freund
eaf13f3bcf
Don't recreate transaction timer unnecessarily 2020-06-02 00:18:28 +02:00
Isaac Freund
939beef168
Split river and riverctl directories 2020-06-01 15:56:50 +02:00