Commit Graph

60 Commits

Author SHA1 Message Date
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
89433073d6 command: Remove allocator arg 2022-02-08 13:53:52 +01:00
da59632cea code: Cleanup use of std library for consistancy 2022-02-08 12:02:05 +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
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
c1d985ac29 build: update to zig version 0.9.0 2021-12-24 05:28:14 +00:00
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
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
9212ac89fa Cursor: fix pointer drags with focus-follows-cursor 2021-11-19 11:33:27 +01: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
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
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
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
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
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
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
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
c0a2286847 code: update to zig 0.8.0 2021-06-05 17:29:58 +00:00
6333e465d2 Allow changing output focus with pointer 2021-05-19 14:15:28 +02:00
c8b1017923 river: remove Seat.input_manager
This is no longer needed as server is global.
2021-05-13 15:13:17 +02:00
ece465b7ed river: remove InputManager.server
The server is now global so this is no longer needed.
2021-05-13 14:53:08 +02:00
26b0acddb7 river: pointer-constraints and relative-pointer 2021-02-22 14:47:31 +01:00
98d51f6d24 Use std.log instead of log.zig 2021-02-08 18:35:11 +01:00
4984944c60 Config: move opacity settings to sub struct 2020-12-31 15:52:03 +01:00
cc08be2dee code: clean up listener initialization 2020-12-31 15:35:35 +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
49bf0e679f focus-follow-cursor: Change output focus when needed 2020-12-07 13:51:06 +01:00
807d4a4212 keyboard: handle destruction 2020-11-29 21:05:27 +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
03a2da9690 Introduce mode "locked"
This mode is automatically entered when the screen is locked.
2020-10-19 16:00:17 +02:00
036f9a1cb9 Always set fullscreen views to fully opaque 2020-10-08 18:41:47 +02:00
18f5fcb1ef Implement primary selection 2020-10-06 17:46:05 +02:00
b67ea748a3 Implement configurable view opacity with fade effect 2020-10-05 23:03:57 +02:00
27b666dbba code: update to zig master in prep for 0.7.0
This commit makes the minimal necessary changes to get things working,
there are further changes which can be made to take advantage of new
features.
2020-10-02 20:34:24 +02:00
52cd871151 Implement map -release 2020-09-15 15:58:54 +02:00
f597e7da63 seat: implement drag and drop 2020-09-14 20:11:25 +02:00
989e7aaeda config: implement map-pointer command
This command takes a mode, modifiers, button/event name, and pointer
action as arguments. It stores these in the config data structure.

The currently available pointer actions are move-view and resize-view,
which replace the previously hard-coded functionality.

Closing the hovered view with middle click has temorarily been removed
until it is decided if we wish to make this another special pointer
action or perhaps allow running any arbitrary command (which would of
course include close).
2020-08-24 18:57:43 +02:00
71a751f1ad seat: clean up initialization 2020-08-21 21:06:58 +02:00
7274761069 cursor: leave mode if target view is destroyed 2020-08-21 16:31:39 +02:00
db416eb119 view stack: rework iteration for flexibility
There is now a single iter() function which accepts a filter and context
allowing users of the api to filter the views in any arbitrary way. This
change allowed for a good amount of code cleanup, and this commit also
ensures that the correct properties are checked in each case, including
the new View.destroying field added in the previous commit. This fixes
at least one crash involving switching focus to a destroying view.
2020-08-21 16:31:39 +02:00
7de2edb623 seat: implement kde idle protocol 2020-08-13 12:22:32 +02:00
7a6ac8eb6e seat: set focus before starting transactions
Focus was made double-buffered in 96a91fd. However, much of the code
still behaved as if focus was separate from the transaction system.
This commit completes the work started in 96a91fd and ensures that
focus is applied consistently in a single transaction.
2020-08-13 11:17:15 +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
0ebb5ccc17 code: update to wlroots 0.11.0 2020-07-16 21:20:43 +02:00
101f47d78f code: use a tagged union to store focus
This simplifies the code and is more robust than two separate pointers.
2020-07-15 14:15:17 +02:00
d292e61cfd cursor: implement moving views 2020-07-07 19:06:52 +02:00
341fe1e977 code: handle out of memory as well as possible 2020-07-05 22:49:17 +02:00
86386e84bc output: introduce state struct
This simplifies the handling of the current/pending tags and will be
used in the future for atomic layout updates involving layer surface
exclusive zones.
2020-07-02 21:56:26 +02:00
eb1e66b0fe seat: prioritize fullscreen views for focus 2020-06-29 01:04:37 +02:00