Commit Graph

87 Commits

Author SHA1 Message Date
Isaac Freund
677766956e
deps: update to lastest zig-wlroots
This fixes a few issues with the XwaylandSurface bindings
2023-12-06 11:00:45 +01:00
Isaac Freund
7ee6c79b6b
build: update to wlroots 0.17 2023-12-01 17:29:05 +01:00
Isaac Freund
c4fe1e1a3f
rules: rename "tag" action to "tags"
This rule action accepts and assigns a set of 32 tags represented as a
32 bit integer just like all of river's other commands handling tags.

Using the singular here is potentially misleading and is also
inconsistent with set-view-tags, etc. which all use the plural.

Sorry about the breaking change for those who use master branch, ideally
I would have caught this before merging but at least I noticed before a
release.

This commit also does a bit of internal refactoring/cleanup of the rules
system.
2023-11-08 11:33:27 +01:00
Isaac Freund
2e586c7061
build: update to Zig 0.11.0 2023-10-16 16:27:03 +02:00
Isaac Freund
b2b2c9ed13
river: add rules system
This is a breaking change and replaces the previous
csd-filter-add/remove and float-filter-add/remove commands.

See the riverctl(1) man page for documentation on the new system.
2023-03-12 16:44:19 +01:00
Isaac Freund
fcb184f0bd
View: add none impl tag for better safety checks 2023-03-10 14:15:15 +01:00
Isaac Freund
f072d19e51
Xwayland: eliminate unneeded user data usage
This is some dead code that is left over from before the scene graph
changes.
2023-03-08 11:37:28 +01:00
Isaac Freund
f21eb4d05b
Xwayland: only raise views if activated 2023-03-06 10:08:10 +01:00
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
ea4e589fdc
river: clean up some uneeded TODOs 2023-03-04 20:58:02 +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
56e4efe68d
Xwayland: fix has_fixed_size heuristic for floating 2023-03-02 17:11:32 +01:00
Isaac Freund
9bfa0ece23
View: handle destroy during inflight layout demand 2023-03-02 16:42:16 +01:00
Isaac Freund
ecb959f068
View: fix frame perfection on unmap 2023-03-01 23:04:42 +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
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
ce7fda4ed9
Xwayland: render using the scene graph 2023-02-28 14:55:59 +01:00
Isaac Freund
1b57fe0aa7
Xwayland: create scene tree 2023-02-28 14:55:58 +01:00
Isaac Freund
f4a8d6dcc9
Output: use separate scene trees for layers 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
168756cbe8
render: remove damage tracking
This will be handled by wlr_scene shortly.
2023-02-28 14:55:58 +01:00
Isaac Freund
615beab2e6
Seat: rework Xwayland Override Redirect focus
Instead of stashing the active view and setting Seat.focused to the
Xwayland OR surface when a child OR surface of a currently focused
Xwayland view is given keyboard focus, keep Seat.focused set to the
Xwayland view.

Such Override Redirect surfaces are commonly used for drop down menus
and the like, and river should behave as if the parent Xwayland view
still has focus.

This ensures that the riverctl focus-view next/prev commands continue to
work as expected while a popup is open, the correct focused view title
will be sent over river status, etc.

It's also cleaner to centralize this logic in XwaylandOverrideRedirect
and keep it out of Seat.zig.
2023-01-12 14:44:55 +01:00
Zakariyya Von Forslun
63610d9440 Seat: keep parent Xwayland view of a focused OR surface activated
Xwayland OR menus may disappear if their parent view is deactivated. The
heuristic and ICCCM input model implemented prior, used to determine whether an
OR surface may take focus, does not cover all menus, so retaining parent view
activation works as a catch-all solution for handling unwanted OR menu focus.
2023-01-12 06:56:11 +10:00
Isaac Freund
096e175cec
View: honor fullscreen requests before map 2022-12-24 03:06:53 +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
03e8da669c
Xwayland: Rename XwaylandUnmanaged to XwaylandOverrideRedirect 2022-05-30 01:08:09 +02:00
Zakariyya Von Forslun
e72afab140 Xwayland: add handling of override redirect listeners
Adding the set_override_redirect listener on creation and removing it
on destruction was missed when implementing override redirect state
change handling.
2022-05-29 17:21:15 +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
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
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
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
c1d985ac29
build: update to zig version 0.9.0 2021-12-24 05:28:14 +00: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
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
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
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
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
Isaac Freund
7b18b4944e config: use hash sets for filters, clean up code 2021-07-12 17:57:01 +00:00
Isaac Freund
6f61ea07db
view: ensure surface_box is initailized before use 2021-06-14 22:37:14 +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
13f01bcb4b render: do basic yes/no damage tracking 2021-05-24 16:43:21 +02:00