Commit Graph

64 Commits

Author SHA1 Message Date
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
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
096e175cec View: honor fullscreen requests before map 2022-12-24 03:06:53 +01:00
49efbfe046 session-lock: handle output unplugging better 2022-11-13 16:45:18 +01:00
489a49735a river: update to wlroots 0.16 2022-11-13 16:16:07 +01:00
03e8da669c Xwayland: Rename XwaylandUnmanaged to XwaylandOverrideRedirect 2022-05-30 01:08:09 +02:00
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
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
6ef97eea24 Xwayland: handle override redirect state changes 2022-05-29 16:28:07 +02:00
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
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
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
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
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
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
c1d985ac29 build: update to zig version 0.9.0 2021-12-24 05:28:14 +00:00
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
4b94b9c083 Xwayland: honor fullscreen requests 2021-10-12 18:47:08 +02:00
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
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
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
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
7b18b4944e config: use hash sets for filters, clean up code 2021-07-12 17:57:01 +00:00
6f61ea07db view: ensure surface_box is initailized before use 2021-06-14 22:37:14 +00:00
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
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
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
5e09b853f7 xwayland: allow setting size if unmapped/floating
This effectively allows unmapped and floating xwayland views to set
their own dimensions, which seems to make some popups less broken.
2021-01-31 18:24:21 +01:00
7249f5c9c3 xwayland: use layout coords for configures 2021-01-07 22:15:42 +01:00
b73cb7bb69 render: draw popups over borders 2021-01-05 20:05:35 +01:00
a2ef687e51 view: fix handling of title/app_id change 2021-01-01 13:29:57 +01:00
cc08be2dee code: clean up listener initialization 2020-12-31 15:35:35 +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
760c88b094 foreign-toplevel-management: basic implementation
We do no yet set the parent of toplevels. We also only honor activate
requests if the target view is already visible on the focused output.
2020-12-24 13:07:59 +01:00
518fb96604 xwayland: handle hinted dimension < View.min_size
This avoids an assertion failure in std.math.clamp() when applying the
constraints.
2020-12-18 18:59:13 +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
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
ac1762567c Send zriver_seat_status_v1.focused_view when title of focused view changes 2020-10-25 17:28:13 +01:00
e4a3698d86 view: update comments
These should have been moved in the previous commit
2020-10-22 19:24:01 +02:00
79dc9cc49a xwayland: make behavior more like xdg toplevels
- float fixed size xwayland windows by default
- align configure handling with that of xdg toplevel views
2020-10-22 19:22:54 +02:00
5cea3f68e3 xwayland: clean up initialization 2020-08-21 16:48:17 +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
340bfbd7f1 xwayland: fix signed to unsigned int casting error 2020-08-13 13:47:14 +02:00
bd99428766 view: handle setting fullscreen in configure() 2020-08-13 11:17:15 +02:00
946e4f21ba Enforce minimum window size also for views with constraints 2020-08-10 22:15:09 +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
d6823fe3a0 cursor: handle xwayland views for move/resize 2020-07-31 17:06:26 +02:00
9f3ee76e51 cursor: implement resize 2020-07-31 17:06:26 +02:00