Commit Graph

164 Commits

Author SHA1 Message Date
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
9e70fb25a5 output: fix debug log on tag change 2021-07-28 13:44:23 +02:00
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
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
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
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
1fec079266 Fix typo s/ouput/output/ in function name 2021-07-19 12:01:10 +00:00
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
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
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
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
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
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
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
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
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
9e3e92050e river: update for wlroots 0.13.0 2021-04-08 00:21:17 +02:00
98d51f6d24 Use std.log instead of log.zig 2021-02-08 18:35:11 +01:00
cc08be2dee code: clean up listener initialization 2020-12-31 15:35:35 +01:00
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
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
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
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
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
10373da634 code: Add Root.removeOutput 2020-12-07 11:47:55 +01:00
fc549d6249 code: Refactor Root.addOutput 2020-12-07 11:47:55 +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
d23b8a7f27 code: Move wlr_output_layout_add from Output.init to Root.addOutput 2020-11-02 14:08:00 +01:00
1bd6f6bed1 code: Remove most of the hack around @cImport and flexible arrays 2020-10-30 15:23:52 +01:00
b67ea748a3 Implement configurable view opacity with fade effect 2020-10-05 23:03:57 +02:00
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
f597e7da63 seat: implement drag and drop 2020-09-14 20:11:25 +02:00
dd425a3e66 root: clean up initialization 2020-08-21 21:06:59 +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
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
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
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
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
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
014963612c river-status: fix bug sending old output tag state 2020-07-06 11:09:23 +02:00
341fe1e977 code: handle out of memory as well as possible 2020-07-05 22:49:17 +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
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
79bb0accac code: improve error handling consistency 2020-06-26 00:59:31 +02:00
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
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
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