Commit Graph

514 Commits

Author SHA1 Message Date
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
7b4c9c39ee
DragIcon: Properly initialize if already mapped 2022-02-26 16:54:48 +01:00
Hugo Machet
89433073d6 command: Remove allocator arg 2022-02-08 13:53:52 +01:00
Hugo Machet
da59632cea code: Cleanup use of std library for consistancy 2022-02-08 12:02:05 +01:00
Hugo Machet
995ae99be5 Mode: Use ArrayListUnmanaged to save memory 2022-02-08 11:56:24 +01:00
pmkap
ca47b8a54e
command: allow targeting outputs by name
This extends focus-output and send-to-output to allow targeting
outputs by name instead of relative position.
2022-02-06 15:41:40 +01:00
Leon Henrik Plickat
422cd3e01f
input: Improve input device name format
The name now includes the type, for the case of a physical device
advertising more than one logical device.
2022-02-05 18:52:46 +01:00
Leon Henrik Plickat
53f84b76f3
input: keep applying input configs after first match
Device identifiers aren't so unique after all
2022-02-05 18:52:16 +01: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
Leon Henrik Plickat
214ad65b72
Cursor: update image if needed on xcursor theme change 2022-01-29 15:40:29 +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
745fe82947
layer-shell: center when opposing anchors are set
Currently river will place the surface at the top or left edge if
opposing anchors are set without a 0 width/height. Instead, center
the surface between the anchors.
2022-01-25 00:11:20 +01:00
Isaac Freund
b716e262cd
XdgPopup: remove commit listener on destroy if mapped
Since the destroy() function may be called by river while the popup is
mapped, we must handle this case.
2022-01-23 20:37:37 +01:00
Hugo Machet
a782c6a6f2
Xwayland: Handle minimize request
Fix X11 clients getting stuck minimized, and displaying a black screen
after they lose focus.
2022-01-18 16:14:33 +01:00
Hugo Machet
0116dfe96e command/map: Warn users on keybinding overwritten 2022-01-17 18:19:39 +01:00
Isaac Freund
f79c784e84
command/map: add Alt/Super as aliases for Mod1/Mod4
I personally made the mistake of using Alt instead of Mod1 when messing
with my config. This change makes things a bit more user
friendly/intuitive.
2022-01-17 12:38:41 +01:00
Isaac Freund
c9fd8b3f37
XdgPopup: fix unconstrain from box coords
We currently don't properly handle xdg surface geometry of the parent,
which causes popups to render partially off-screen in some cases.

GTK4 clients such as easyeffects seem to trigger this issue reliably.
2022-01-12 14:50:55 +01:00
Isaac Freund
a340a605a4
Cursor: remove minor outdated workaround
Since Zig 0.9 @tagName() and other similar builtins return 0 terminated
data.
2022-01-05 18:13:08 +01:00
Isaac Freund
1c515759b4
Seat: do a better job of cleaning up listeners
I thought this should be fine as river won't yield to the event loop
when Seat.deinit() is called before the wlroots seat is destroyed, but
a segfault on exit has been reported with a stack trace mentioning
wlr_seat_destroy(). Let's hope this clears that up.
2022-01-02 19:46:18 +00:00
Isaac Freund
e16eabd928
Xwayland: move window to top of X11 stack on focus
This is required for X11 input handling to work properly with
overlapping windows.
2022-01-02 04:32:28 +00:00
Isaac Freund
ea4bd5e54b
Cursor: fix down mode motion events for subsurfaces
There are a couple of TODOs here that are not worth resolving until
after moving to the scene graph api.
2021-12-29 06:19:37 +00: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
90aee02b70
Subsurface: add commit listener on create if mapped
Subsurfaces may already be mapped when create is called, in which case
we must add the commit listener.
2021-12-22 05:30:20 +00:00
Isaac Freund
334ede00e1
Cursor: properly handle clients setting the cursor image
The new code to dedup XcursorManager.setCursorImage() calls for
efficiency currently doesn't handle clients setting the cursor properly.
This commit corrects this oversight.
2021-12-22 04:32:23 +00:00
Isaac Freund
c34d850397
layer-shell: fix regression from wlroots 0.15 update
The way wlroots handles the layer surface configure flow has changed a
bit and river's logic needs updating.
2021-12-21 19:41:47 +00:00
Isaac Freund
f2fc9aca18
Cursor: dedup XcursorManager.setCursorImage() calls
wlroots doesn't avoid re-setting the same cursor image so this is
relatively expensive to call repeatedly if nothing has changed.
2021-12-21 03:50:12 +00:00
Isaac Freund
4d19621f1e
river: update to wlroots 0.15.0 2021-12-21 03:18:30 +00:00
Isaac Freund
c3370afa3d
common/flags: make argFlag() return a slice
We always pass the result of this to mem.span() currently, no need for
the code duplication.
2021-12-15 17:09:45 +01:00
Leon Henrik Plickat
d93ee2c27e
Cursor: improve output focus handling on button press
This patch allows to focus outputs by clicking on the empty background and by
clicking on layer surfaces without keyboard interactivity. This makes it
possible to use the cursor to focus outputs with no visible views.

This also fixes problems with pointer interactive layer surfaces (for example
launchers and docks) on non-focused outputs.
2021-12-10 23:40:48 +01:00
Isaac Freund
93afdb32bf
layer-shell: tighten up handling of large margins 2021-11-29 23:56:26 +01:00
Isaac Freund
bd70c010e9
Cursor: add workaround in pointer drag termination
Currently wlroots sends use the drag destroy event before sending the
wl_data_device.leave event to the client, which makes things a bit
awkward. My patch fixing this has been merged to wlroots master so we
can remove this when upgrading to wlroots 0.15, but until then this
workaround will fix the issue.
2021-11-23 22:54:19 +01:00
Isaac Freund
9212ac89fa
Cursor: fix pointer drags with focus-follows-cursor 2021-11-19 11:33:27 +01:00
Isaac Freund
69d1453741
build: fix trailing newline in version string 2021-11-02 23:54:44 +01:00
Isaac Freund
f2cf4b9455
common: use -h instead of -help
This doesn't really matter that much as unrecognized options will still
trigger a help message to be printed, but -h is much more standard so
lets make the predictable choice here while sticking to only single '-'
flags.
2021-11-01 00:34:15 +01:00
Isaac Freund
8757644b2a
docs: standardize on "layout generator"
This is likely more clear than "layout client" to most users.
2021-10-31 22:32:59 +01:00
Isaac Freund
8134b81283
Cursor: fix move/resize with high poll rate/low dpi mice 2021-10-30 20:40:35 +02:00
Isaac Freund
4b0c5acc46
View: fix checks to respect client side move/resize 2021-10-30 12:54:23 +02:00
Isaac Freund
b986196118
view: respect client size resize of floating views
mpv for example has key bindings to set the window size to a multiple of
the video resolution. This is a valid use case for client-size resizing
of the view and river should respect this if the view is floating.
2021-10-30 12:22:49 +02:00
Isaac Freund
e447e1b41f
Xwayland: always send configure if requested
This seems to fix an issue with mouse input for steam if steam is not
started on an output at 0,0. X11 is pretty spooky.
2021-10-20 15:40:50 +02:00
Isaac Freund
c84fd1a936
View: send enter/leave events to full surface tree 2021-10-20 14:11:19 +02:00
Isaac Freund
5bf7d22972
Cursor: only trigger focus-follow-cursor on motion
This greatly improves the UX of this feature, as views moving under a
stationary cursor (as happens during the zoom command for example) will
no longer trigger focus change.
2021-10-20 13:22:24 +02:00
Isaac Freund
4b94b9c083
Xwayland: honor fullscreen requests 2021-10-12 18:47:08 +02:00
Isaac Freund
50814e0ffe
pointer-constraints: fix coordinates
Currently the implementation treats the x/y coordinates of
View.State.box as layout coordinates instead of output-relative. This
causes issues when using an output not at 0,0.
2021-10-11 15:01:57 +02:00
Leon Henrik Plickat
196c52885f Decrease layout demand timeout to 100ms
Layout generators are generally pretty fast. The timeout is only reached when
the generator is faulty / stuck. In that case, freezing for 1 second is simply
bad UX.
2021-10-04 11:07:59 +02:00
Isaac Freund
5b8eab569c
Server: fix use after free in deinit()
The input manager and seats must be destroyed before the display is
destroyed as they need to destroy their timer event sources used for key
repeat.
2021-10-02 14:48:23 +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
8ec0e30fd7
Subsurface: remove commit listener in destroy()
Currently if destroy() is called while a subsurface is mapped a dangling
commit listener is left behind. This is obivously a problem, so check if
the subsurface is mapped in destroy() and remove the listener if needed.
2021-09-30 16:45:14 +02:00
Isaac Freund
a3fdb294b3
Cursor: implement surfaceAt() for XwaylandUnmanaged 2021-09-27 18:34:59 +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
Leon Henrik Plickat
ab55ab8fc2 command: Use std.ComptimeStringMap to get impl. function from command string 2021-09-16 11:47:44 +02:00
Peter Rice
81d103d425 river: add send-to-previous-tags command 2021-09-14 22:57:17 +02:00
Ben Fiedler
5f6428bafe river: Allow applying CSD based on window titles
This extends the `csd-filter-add` command to allow matching on window
titles as well, using a `csd-filter-add kind pattern` syntax. The
following kinds are supported:

  * `title`, which matches window titles
  * `app-id`, which matches app ids

Only exact matches are considered.

As an example following configuration applies client-side decorations to
all windows with the title 'asdf with spaces'.

    riverctl csd-filter-add title 'asdf with spaces'
2021-09-07 12:30:53 +00: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
Ben Fiedler
7b97d519b3 river: Fix errdefer in floatFilterAdd 2021-09-06 15:19:11 +00:00
Ben Fiedler
546252aecf river: Allow floating based on window titles
This extends the `float-filter-add` command to allow matching on window
titles as well, using a `float-filter-add kind pattern` syntax. The
following kinds are supported:

  * `title`, which matches window titles
  * `app-id`, which matches app ids

Only exact matches are considered.

As an example following configuration floats all windows with the title
'asdf with spaces'.

    riverctl float-filter-add title 'asdf with spaces'
2021-09-06 12:44:25 +00: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
Keith Hubbard
2bdf9e20a5
command: support repeating keyboard mappings
Repeating mappings are created using the -repeat option to the map
command:

    % riverctl map normal $mod+Mod1 K -repeat move up 10

- repeating is only supported for key press (not -release) mappings
- unlike -release, -repeat does not create distinct mappings: mapping a
  key with -repeat will replace an existing bare mapping and vice-versa

Resolves #306
2021-08-15 14:49:11 +02: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
1e18ac9d74
layer-shell: ignore commits on closed layer surface 2021-08-12 21:18:26 +02: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
e752555969
config: fix leak of default layout namespace 2021-08-09 16:48:51 +02:00
Isaac Freund
7013bc3b69
Xwayland: fix possible use-after-free on unmap
The view.unmap() call may synchronously destroy the view, which makes
the the code removing listeners which is currently run after
view.unmap() access free'd memory.

To fix this, simply change the order of the calls to match that of
XdgToplevel.handleUnmap().
2021-08-09 16:40:45 +02:00
Keith Hubbard
556d790694 render: draw borders before rendering views
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.
2021-08-07 10:18:52 +00:00
Isaac Freund
2fc0875a3e
river: fix crash on disabling all outputs
If using the on-output-change cursor warp option river currently crashes
when the last real output is disabled as the noop output used as a
fallback is not present in the output layout.
2021-08-02 16:16:58 +02:00
Isaac Freund
2f3fe5019b
util: remove unused function 2021-07-31 00:57:23 +02:00
Isaac Freund
00f51e00b4
cursor: remove strict focus-follows-cursor mode
This is pretty much unusable after recent improvements to the cursor
code, and was totally broken causing a stack overflow as soon as the
cursor was moved over any surface until the previous commit.

Furthermore, none of the core contributors or people active on IRC seem
to use it.
2021-07-29 14:05:17 +02:00
Isaac Freund
bae826ef0e
cursor: fix crash if focus-follows-cursor is set
Currently we hit a stack overflow as we do not check if the target view
already has keyboard focus before calling Seat.focus() in
Cursor.passthrough(). To fix this, simply add this check.
2021-07-29 13:42:36 +02:00
Isaac Freund
863f8156f7
river: properly teardown surface tree
When an xdg toplevel, layer surface, etc is destroyed, it is not
guaranteed that all the children in the surface tree have already been
destroyed. If there are still children around, destroying the root of
the tree would leave dangling pointers.

To fix this, destroy all children when destroying any node in the tree.
2021-07-28 13:44:23 +02:00
Isaac Freund
9e70fb25a5
output: fix debug log on tag change 2021-07-28 13:44:23 +02:00
Isaac Freund
8a1e96cddc
config: change color format to 0xRRGGBBAA
The current format of #RRGGBBAA is problematic as # starts a comment
in POSIX compliant shells, requiring escaping/quoting and increasing
complexity.

This is a breaking change.
2021-07-26 20:36:46 +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
988a4623ab
view: ensure saved buffers are always dropped
Currently if a view is moved from layout to fullscreen while a
transaction involving that view is in progress the saved buffers are not
dropped, which causes stale state to be rendered.
2021-07-25 22:22:46 +02:00
Isaac Freund
eab9c0901a
layout: assert output state matches layout applied
This is guaranteed to already be set to the layout being committed. It
is set either when a client binds a new layout object or when the user
changes the layout namespace in use.
2021-07-25 22:17:40 +02:00
Isaac Freund
4cc1167863
river: improve new layer surface log formatting 2021-07-25 17:17:45 +02:00
Isaac Freund
734521560b
river: add custom wlroots log handler
This makes river's log output more consistent and will allow
filtering by the wlroots scope in the future.
2021-07-25 01:22:36 +02:00
Isaac Freund
c26d18647b
river: simplify log levels exposed to the user 2021-07-24 20:45:58 +02:00
Isaac Freund
23088b800c
common: standardize on -help option
Also:

- Check for -help option *before* unknown options
- Use common flags parsing code for riverctl
- Add usage text to riverctl
2021-07-24 19:31:04 +02:00
Isaac Freund
a5a505ecba
common: remove support for positional arguments
This is currently unused and I don't like the approach anymore
regardless. If/when we need positional arguments (probably when
implementing the upcoming river-control protocol in rivertile)
they should be handled separately from flags.

This commit also improves the CLI error reporting to always print the
usage string if invalid arguments were passed.
2021-07-24 18:29:48 +02:00
Isaac Freund
f6fa3425de
river: use common CLI arg parsing code
This makes river's main() function quite a bit cleaner.
2021-07-24 16:44:11 +02:00
novakane
32d35cdf91 Add -version flag to river, riverctl and rivertile 2021-07-24 14:14:53 +00:00
Isaac Freund
9c633a7888
layout: cleanup in progress layout demand on destroy
This fixes an issue where a layout client that crashed during a layout
demand caused river to enter invalid state and potentially soft-lock.
2021-07-24 14:14:36 +02:00
Isaac Freund
6f91011895
river: fix crash on parsing empty string as color 2021-07-24 10:39:38 +02:00
Isaac Freund
f371e00716
cursor: fix logic in Cursor.updateState()
The previous commit re-introduced a bug fixed by a3c65713 which caused
the pointer enter event not to be sent until moving the pointer when
switching tag focus or otherwise manipulating the window manager caused
the cursor to end up over a new surface.
2021-07-24 02:30:15 +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
b243cd7fc3
river: destroy backend before Root.deinit()
Handling output destroy now requires the wlr_output_layout to still be
around, as we need it to properly handle cursor state. In order to make
sure that all outputs are destroyed before the wlr_output_layout is,
simply destroy the backend before calling Root.deinit().
2021-07-23 19:03:08 +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
Isaac Freund
f86291169e
cursor: allow commands to override cursor operations
Now that we properly handle state changes during cursor operations,
blocking these commands if the target view is the target of a cursor
operation is unnecessary complexity. It is also inconsistent as we
don't block changing the tags of the view.
2021-07-23 17:11:43 +02:00
Isaac Freund
969d7b0344
cursor: remove surfaceAt() parameters
We always pass the current cursor position, so this is a nice
simplification.
2021-07-23 16:52:48 +02:00
Isaac Freund
7428519a93
cursor: refactor surfaceAt() to return parent
This allows us to properly handle e.g. clicking on a xdg popup of a view
that is not currently focused by focusing that xdg popup's parent view.
2021-07-23 16:33:25 +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
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
b7e15a8ef6
river: make spawn command take only one argument
Currently the spawn command takes any number of arguments and naively
joins them together with spaces before passing them as the single
argument of `/bin/sh -c`. This however produces unexpected results as
soon as shell quoting gets involved in the arguments passed to spawn.
For example, running

riverctl spawn foo "bar baz"

will execute `/bin/sh -c "foo bar baz"`, unexpectedly splitting bar and
baz into separate arguments. To avoid this confusion, make the spawn
command take only a single argument, forcing the user to quote properly
to spawn multi-argument commands.
2021-07-21 14:07:49 +02:00
Isaac Freund
2635f3299a
river-layout: update to v3
- Remove advertise_view and advertise_done events. Using the information
provided by these for any purpose would make the layout far less
predictable. Futhermore, in the months this has been available for use,
to my knowledge nobody has actually used it for anything useful.

- Replace the set/mod layout value events with a single user_command
event. This simplifies the protocol and is more flexible for clients.

- Add a layout_name argument to the commit request. This name is an
arbitrary, user-facing string that might, for example, be displayed by a
status bar. This was present in early drafts of the protocol, but was
removed in favor of river-options. Since river-options itself has since
been removed and this feature is nice to have, re-add it.

- Rename main factor to main ratio in rivertile. The "factor" name was
just legacy from dwm, "ratio" is much more accurate.
2021-07-20 10:48:11 +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
Alexander Taylor
1fec079266 Fix typo s/ouput/output/ in function name 2021-07-19 12:01:10 +00:00
Isaac Freund
0063c722e5
river: remove system /etc dir from init search paths
A true "default" config doesn't make sense for river. Everyone who uses
river seriously will customize their init script. Futhermore, the
current behavior of embedding the install path of the default system
config in the river binary is complex and prone to breaking.
2021-07-17 16:04:51 +02:00
Viktor Nagy
28fc8792d7 river: add focus-previous-tags command 2021-07-15 12:00:22 +00:00
Isaac Freund
604cf98047
command: make args type 0-terminated
Since we often need to pass these args back C code, keeping the 0 byte
around saves some allocations.
2021-07-15 13:32:33 +02: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
7b18b4944e config: use hash sets for filters, clean up code 2021-07-12 17:57:01 +00:00
Leon Henrik Plickat
968aef3459 river: make CSD-filters apply to existing views 2021-07-12 17:57:01 +00:00
Leon Henrik Plickat
9ec04c764e river: add commands to remove filter entries 2021-07-12 17:57:01 +00:00
Isaac Freund
39578db134
render: @panic() if CLOCK_MONOTONIC is not supported
Making this unreachable and invoking illegal behavior is incorrect.
2021-06-27 13:20:36 +02:00
Leon Henrik Plickat
085cca0d5e cursor: add option to warp on output change
On output change, if the cursor is not already on the newly focused
output, it will now be warped to its center. The check is necessary,
since focusing outputs with the pointer will be implemented in
the future.
2021-06-26 19:03:49 +02:00
Isaac Freund
505639432e
Revert "build: assert wlroots version at comptime"
zig-wlroots now has this assert built in

This reverts commit 3392b21aa8.
2021-06-24 20:21:07 +02:00
Isaac Freund
3392b21aa8
build: assert wlroots version at comptime
This will prevent people compiling river against the wrong wlroots
version and wondering why it crashes.
2021-06-24 19:34:15 +02:00
Isaac Freund
41874b47ae code: update to wlroots 0.14.0 2021-06-23 15:35:10 +02:00
Leon Henrik Plickat
d3a9e96f7d Add spacial output operations
List based output operations are tedious for complex output layouts.
2021-06-23 12:47:20 +02: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
5daec347c0
render: damage on background/border color change 2021-06-16 17:42:09 +00:00
Leon Henrik Plickat
3405e2a87c Ignore move and resize requests from fullscreened XDG toplevels 2021-06-16 10:03:30 -07:00
Isaac Freund
f3024d9198
decoration: remove listeners on destroy 2021-06-14 22:55:10 +00:00
Isaac Freund
9ecffe21d8
layout: fix use-after-free in destroy() 2021-06-14 22:45:11 +00:00
Isaac Freund
6f61ea07db
view: ensure surface_box is initailized before use 2021-06-14 22:37:14 +00:00
Isaac Freund
37251c8758
output: handle OutputDamage destroy
This may be destroyed before our output destroy listener is called.
2021-06-14 22:17:01 +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
Leon Henrik Plickat
a267262a17 Add list-input-configs command 2021-06-13 10:37:36 -07:00
Leon Henrik Plickat
3f4fd97b6e Add list-inputs command 2021-06-13 10:37:36 -07:00
Leon Henrik Plickat
833248e805 Add basic input configuration 2021-06-13 10:37:36 -07: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
novakane
2e7c1dbe6a config: make attach-mode global 2021-06-08 18:26:36 +00:00
novakane
75814eb876 view_stack: update tests for zig 0.8.0 2021-06-08 18:25:43 +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
e90474657f
view: send activated/fullscreen configures immediately
The transaction system exists to coordinate size changes of all views
in a layout in order to achieve frame perfection. Since many clients
do not need to commit a new buffer in response to a activated state
change alone, this breaks things when such a configure event is tracked
by the transaction system. Instead, simply send activated and fullscreen
configures right away but still track this state in a double-buffered
way so that e.g. border color changes based on focus are frame-perfect.

This also fixes a related issue with the transaction system where views
that did not need to commit in response to our first configure were not
rendered until their next frame.
2021-06-08 06:00:15 +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
1bacaa5b43
view: get rid of notifyConfiguredOrApplyPending()
This function is only called in one place, just inline the code.
2021-06-08 02:56:19 +00:00
Isaac Freund
cef6d5a0be
render: fix damage tracking of drag icons 2021-06-07 18:34:54 +00:00
Isaac Freund
0e9dc089d1
render: track subsurfaces created before role assignment 2021-06-05 19:30:43 +00:00
Isaac Freund
c0a2286847
code: update to zig 0.8.0 2021-06-05 17:29:58 +00:00
Isaac Freund
ca4abd261f
xdg-toplevel: remove set_app_id listener 2021-05-31 15:46:39 +00:00
Isaac Freund
acaf192465
render: actually damage output on view opacity change 2021-05-31 15:21:42 +00:00
Isaac Freund
9ee788b65e
render: damage output on view opacity change 2021-05-31 01:00:49 +00:00
Isaac Freund
13f01bcb4b render: do basic yes/no damage tracking 2021-05-24 16:43:21 +02:00
Leon Henrik Plickat
6333e465d2 Allow changing output focus with pointer 2021-05-19 14:15:28 +02:00
Isaac Freund
c8b1017923
river: remove Seat.input_manager
This is no longer needed as server is global.
2021-05-13 15:13:17 +02:00
Isaac Freund
50cdcf3ee4
river: remove all stored *Root pointers
These are no longer needed as server is global.
2021-05-13 15:08:53 +02:00
Isaac Freund
3d031631c7
river: remove misc stored *Server pointers
These are no longer needed as server is now global.
2021-05-13 15:06:00 +02:00
Isaac Freund
ece465b7ed
river: remove InputManager.server
The server is now global so this is no longer needed.
2021-05-13 14:53:08 +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
271b1563a8
river: make server a global variable 2021-05-13 14:25:34 +02:00
Isaac Freund
7ccb4794c9 river: always render floating views above layout views 2021-05-05 15:54:52 +02:00