Commit Graph

97 Commits

Author SHA1 Message Date
Isaac Freund
3141940efb
map-pointer: minor fixes and cleanups 2022-11-25 14:06:31 +01:00
Alexander Courtis
cacc986166
map-pointer: allow running arbitrary commands 2022-11-25 14:05:36 +01:00
Isaac Freund
33187e0b09
ext-session-lock: implement protocol 2022-11-13 16:45:18 +01:00
Isaac Freund
78a46c316a
input-inhibit: remove support for protocol
The only valid use-case for this as far as I'm concerned is lockscreens,
which will now be supported through ext-session-lock-v1.
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
2eb013e214
Cursor: implement initial touch support
Still TODO are:
- Touch support for drags
- Mapping input devices to outputs (necessary for good multi-monitor
touch support)

Co-authored-by: Daan Vanoverloop <daan@vanoverloop.xyz>
2022-06-22 11:06:35 +02:00
Zakariyya Von Forslun
bd03484b28 Xwayland: restrict OR focus changes based on ICCCM input model
Some popup menus are not covered by the `overrideRedirectWantsFocus()`
heuristic (e.g. in IntelliJ IDEA), so before focusing an OR window,
its input model should also be checked to ensure that it is able to
take input focus. This appears to fix the popup menus in IntelliJ IDEA,
which would otherwise disappear immediately due to unwanted focus.
2022-06-22 11:03:02 +02:00
Zakariyya Von Forslun
9b04109c82 Cursor: fix focus for Xwayland override redirect windows
Setting focus on button click for override redirect windows did not
consider whether the window actually wants focus.
2022-06-09 15:10:55 +10:00
Isaac Freund
50c9e3d81b
Cursor: revive 'always' focus-follows-cursor mode
This was removed a while back because it was buggy and I didn't know
of anyone using it. Since refactoring it is now trivial to implement
and I know of at least one person using it, so I don't mind reviving it.
2022-06-03 12:03:08 +02:00
Isaac Freund
03e8da669c
Xwayland: Rename XwaylandUnmanaged to XwaylandOverrideRedirect 2022-05-30 01:08:09 +02:00
Zakariyya Von Forslun
8a8dd9ff65 cursor: fix Xwayland unmanaged surfaceAt coordinates
The x and y coordinates for unmanaged Xwayland views were reversed
in the fullscreen branch of the surfaceAt() function.
2022-05-29 16:26:16 +02:00
Zakariyya Von Forslun
7b554bde68 xwayland-unmanaged: handle focus on map/cursor button
This implements keyboard focus on map for unmanaged Xwayland views
using wlroot's heuristic approach as well as keyboard focus on cursor
button click.
2022-05-29 16:26:16 +02:00
Isaac Freund
e0246c0410
Cursor: Don't passthrough() on update if hidden
Currently when the surface under the hidden cursor changes, we
passthrough() which results in the cursor being made visible and giving
pointer focus to the surface under the cursor if any. Obviously this is
not desirable as the cursor is supposed to remain hidden until moved.
This added check prevents this.
2022-04-19 11:10:53 +02:00
Duncan Overbruck
0b8758a422
Cursor: Add a hide-cursor command
From the riverctl.1 man page:

*hide-cursor* *timeout* _timeout_
    Hide the cursor if it wasn't moved in the last _timeout_
    milliseconds until it is moved again.
    The default value is 0, which disables automatically hiding the
    cursor. Show the cursor again on any movement.

*hide-cursor* *when-typing* *enabled*|*disabled*
    Hide the cursor when pressing any non-modifier key. Show the cursor
    again on any movement.
2022-04-14 13:37:31 +02: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
Leon Henrik Plickat
214ad65b72
Cursor: update image if needed on xcursor theme change 2022-01-29 15:40:29 +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
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
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
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
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
9212ac89fa
Cursor: fix pointer drags with focus-follows-cursor 2021-11-19 11:33:27 +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
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
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
a3fdb294b3
Cursor: implement surfaceAt() for XwaylandUnmanaged 2021-09-27 18:34:59 +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
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
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
d413db9227
xdg-shell: set resizing state during interactive resize 2021-07-14 15:32:24 +02: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
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
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
7ccb4794c9 river: always render floating views above layout views 2021-05-05 15:54:52 +02:00
Isaac Freund
0c8e718d95
cursor: handle popup subsurfaces properly
I added the required functions in wlroots 0.13.0, so use them.
2021-04-27 18:56:06 +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
Bonicgamer
26b0acddb7 river: pointer-constraints and relative-pointer 2021-02-22 14:47:31 +01:00