Commit Graph

1266 Commits

Author SHA1 Message Date
Isaac Freund
db366e9455
Xwayland: fix View.fromWlrSurface for OR surfaces 2022-06-24 12:05:54 +02:00
Isaac Freund
7d9d889226
deps: update to latest zig-wlroots
This fixes a nasty ABI bug that could cause river to crash when
hotplugging down to 0 outputs.
2022-06-23 18:50:00 +02: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
Isaac Freund
5cce49095a
Seat: refactor InputDevice handling
- The lifetimes of the Keyboard and Switch structs are now directly
tied to the corresponding InputDevice, which has become a field of
those structs.

- Seat capabilities are now properly updated on removing a keyboard.

These changes align with input device refactoring in upstream wlroots
which will make updating to easier 0.16.0.
2022-06-21 16:25:37 +02:00
Isaac Freund
67d07e84b0
InputDevice: use "switch" in input device names
Currently we use "switch_device" because that's what the enum variant
happens to be named in zig-wlroots so that it doesn't conflict with the
switch keyword.

This however wasn't really thought through and "switch" makes more sense
to expose to the user.
2022-06-20 19:51:34 +02:00
Isaac Freund
c40dc5ee75
InputDevice: move to separate file 2022-06-20 16:29:35 +02:00
Isaac Freund
78d96d19e4
example/init: don't use exec
This causes far too much unnecessary confusion for people new to shell
scripting and is fairly pointless anyways.
2022-06-17 19:29:28 +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
Leon Henrik Plickat
37da205be0
river: error out if default init is not executable 2022-06-06 21:53:55 +02:00
Isaac Freund
a413790158
build: don't scan xdg-output
This was used for the river-options protocol implementation in riverctl
and is no longer needed since the river options protocol got removed.
2022-06-03 23:31:07 +02: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
2df2151afa
river-status: only send mode event if client bound version 3 2022-06-02 12:21:57 +02:00
Isaac Freund
d657dc791b
river-status: add mode event to seat status
This allows clients such as a status bar to display the currently active
mode.
2022-06-01 00:15:09 +02:00
Isaac Freund
03e8da669c
Xwayland: Rename XwaylandUnmanaged to XwaylandOverrideRedirect 2022-05-30 01:08:09 +02:00
tiosgz
1e3b8ed161 Seat: avoid leaking eaten keys to client on focus
Until now, Seat.setFocusRaw sent all pressed keys to the client,
including ones that should be eaten. (Try e.g. changing focus to a
nested wlroots compositor with a terminal open to easily see it.)

However, only filtering out the eaten keys is not enough; they were
eaten only once all mappings had been executed. Therefore, the original
function had to be split into one looking up mappings and another
executing them.
2022-05-29 23:12:21 +02:00
tiosgz
6d6646febe Keyboard: eat key release event for mappings
Until now, only the event (press/release) for which a mapping was
present got eaten, and the other was passed to the client. From this
commit, a press mapping eats both events and a release mapping eats
nothing (and a press+release combo eats both).

This fixes behavior of some clients that do not make a difference
between press and release (e.g. Firefox with a fullscreen video
exiting fullscreen even on an Esc release event).
2022-05-29 23:12:21 +02:00
Isaac Freund
706dca9b1a ci: fix xbps invocation 2022-05-29 20:17:39 +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
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
Jan Evers
0dd5ad032c
example/init: fix typos 2022-05-24 23:23:45 +02:00
Isaac Freund
d1997139cc
docs: add note on example init file to PACKAGING.md 2022-05-22 19:17:14 +02:00
Isaac Freund
71ba891850
docs: expand on -Dcpu in PACKAGING.md 2022-05-22 16:17:55 +02:00
Isaac Freund
d0625d668a
docs: create PACKAGING.md 2022-05-22 15:35:42 +02:00
Isaac Freund
3cb6428da6
build: add -Dstrip and -Dpie build options 2022-05-22 15:25:38 +02:00
Isaac Freund
ded490d3dd
Output: remove overzealous assert
If running river with WLR_BACKENDS=headless, every output is headless
not just the noop output.
2022-05-20 15:13:28 +02:00
Isaac Freund
7c440b834e
build: follow semantic versioning for -dev versions
The new version format is 0.2.0-dev.76+d1cf95b which is compliant to the
semantic versioning 2.0.0 spec and sorts better than the old format.
2022-05-16 22:34:43 +02:00
Isaac Freund
7122df7ec4
layer-shell: fix overflow if desired size exceeds output bounds 2022-05-16 19:03:23 +02:00
Peter Kaplan
47c02ebcbc Mapping: Do not translate keys with xkb
When checking keys for matching mappings, previously we did two checks:

1. Keysyms translated by xkb.
2. Raw keysyms

This commit removes the first check, so only the second is checked.

We're doing this because of strange behavior that xkb shows for some
layouts and keys. When pressing `Shift Space` on some layouts (Swedish
among others), xkb reports `Shift` as consumed. This leads to the case
that we cannot distinguish between `Space` and `Shift Space` presses
when doing a correct translation with xkb.
2022-05-15 23:08:34 +02:00
Isaac Freund
d47be3b592
deps: update to latest zig-wayland 2022-05-11 18:02:32 +02:00
dfangx
d5c915e3cb
idle-inhibit: implement protocol 2022-05-11 14:14:01 +02:00
Isaac Freund
90b37645cf
ci: make wget output non verbose
This still prints errors, but doesn't print progress bars or other
superfluous information.
2022-05-01 19:03:32 +02:00
tiosgz
56fcab6ee9 Switch: register destroy listener 2022-04-30 18:20:29 +02:00
Jackson Abascal
8da2de3738
input: fix typo in natural-scroll 2022-04-30 12:26:48 +02:00
Peter Kaplan
44aaee3a51 command/map: layout-pinned mappings
e.g. `riverctl map -layout 0 normal Super Y spawn foot`

When this mapping is checked against a pressed key, layout 0 will be used to translate the pressed key instead of the currently active layout.

The number denotes to an index of the layouts set with
`XKB_DEFAULT_LAYOUT`.
2022-04-27 18:31:08 +02:00
Daniel Eklöf
8f59075bc5
completions: fish: new completions for the ‘hide-cursor’ command 2022-04-20 20:33:55 +02:00
Daniel Eklöf
3979dd5cf9
completions: bash: new completions for the ‘hide-cursor’ command 2022-04-20 20:33:50 +02:00
Daniel Eklöf
790de95726
completions: zsh: new completions for the ‘hide-cursor’ command 2022-04-20 19:00:26 +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
Peter Kaplan
a8491eb13e command/hide-cursor: fix crash on missing option 2022-04-14 20:39:35 +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
Peter Kaplan
60fdefc3fd
input: add map-switch/unmap-switch commands
This allows running a command on a laptop's lid being opened/closed
or a tablet's button/switch being pressed/toggled.
2022-04-14 12:49:47 +02:00
Isaac Freund
ae349b0ce4
layer-shell: fix overflow with large bottom margin 2022-03-28 12:11:28 +02:00
Hugo Machet
aa684aa936
ci: Fix builds manifests
Remove `.git` suffix from river repo in `sources` section as the
suffix make the ci only clone the repo. Without the suffix the ci
checkout the correct commit to build river.

We don't need to remove the suffix from others sources as cloning
the repo and checkout the tag version we want is enough.
2022-03-06 12:01:27 +01:00
Isaac Freund
adf6e1f19d
layer-shell: allow surfaces larger than the output
The motivation for this change is to simplify the implementation
and remove a massive footgun that is currently present and causing
UB/crashes. If a layer surface is destroyed in arrangeLayers() then
the code in LayerSurface.handleCommit() after the arrangeLayers()
call accesses free'd memory. This is of course possible to fix,
but it's far simpler to loosen up the protocol implementation a bit.

The new implementation is also in line with what sway and the new
wlroots layer shell helper do and is perfectly valid according to
the protocol.
2022-03-05 14:25:20 +01:00
Leonardo Gibrowski Faé
c4c0bece59
docs: fix typo in river(1) man page 2022-03-05 12:24:38 +01: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