Commit graph

31 commits

Author SHA1 Message Date
tokyo4j
25f5cdd3a6 Refactor the logic of placing client-menu with ShowMenu action
Before this commit, we assumed `ShowMenu` action is not bound to any
buttons other than window menu button and always place the client-menu
under the window-menu button when atCursor="no". Also, it was going to be
difficult to distinguish whether the action is executed from the window
menu button or the window icon, which will be added soon.

This commit fixes it to open the menu under the actually-clicked button by
passing `cursor_context` to `actions_run()`, with some refactoring:
- `seat->pressed.resize_edges` is removed and it's calculated from the
  cursor position and `seat->pressed.type` just before running Resize
  action. This slightly changes the existing logic to determine the
  resizing edges with Alt-Right + Drag mousebinding, but
  `seat->pressed.type` is still stored on button press so it doesn't bring
  back the issue #543.
- `seat->pressed.toplevel` is removed and `get_toplevel()` in
  `update_pressed_surface()` may be called more often, but its overhead
  will be negligible.
2024-09-21 18:07:34 +01:00
Jens Peters
00512d055f input: ensure that our own tablet structs are created 2024-08-13 18:40:34 +02:00
Jens Peters
dd0cee02a4 input: move cursor event listeners from tablet to seat
Otherwise we would subscribe multiple times to the
same event when having multiple tablets.
2024-08-13 18:40:34 +02:00
Jens Peters
f20b2c7632 input: apply tablet rotation before area transformation
This makes the behavior consistent with auto-rotation
as a result of output mapping.
2024-08-08 20:27:06 +01:00
Jens Peters
060626e9c7 input: subscribe to tablet tool events from cursor
Contrary to the raw tablet events, the cursor events transform
the coordinates based on a mapped output orientation.
Otherwise those events are the same.
2024-08-08 20:27:06 +01:00
Jens Peters
f4d203f0cd input: support tablet tool motion sensitivity configuration 2024-07-19 22:45:41 +01:00
Jens Peters
96701f1e27 input: support tablet tool motion configuration 2024-07-19 22:45:41 +01:00
Jens Peters
a2f25bea1a config: add configuration for tablet tool motion 2024-07-19 22:45:41 +01:00
Jens Peters
8501a1281c input: support tablet tools with relative motion 2024-07-19 22:45:41 +01:00
Jens Peters
b663c9ea46 input: fix rotation for tilt
The transformation for relative coordinates
is different than for absolute coordinates.
2024-07-19 22:45:41 +01:00
Consolatis
5c6e1ed878 chase: use wayland pointer enums rather than wlr ones
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4575
2024-07-17 21:28:59 +01:00
Jens Peters
3c0cea92f2 input: support tablet-v2 pad notifications 2024-06-13 21:23:37 +01:00
Jens Peters
61e5e0e4d9 input: track tablets and tablet-pads at seat 2024-06-13 21:23:37 +01:00
Jens Peters
ca317506c0 input: run mousebind action only on button pressed 2024-06-13 21:23:37 +01:00
Jens Peters
f6c91c8d13 input: always notify all tablet axis
Notify all axis based on the capabilities of the
tablet tool. At least GTK applications expect
this for e.g. smooth pressure or distance events.
2024-06-08 22:33:00 +01:00
Jens Peters
15135465d9 input: send tablet proximity-in only above a valid surface
A resize with a tablet tool might end above a
non-tablet capable surface, discard the
proximity-in in that case.
2024-05-28 22:05:06 +02:00
Jens Peters
d65f56e8a5 input: postpone tablet notifications when tip or button is pressed
We should not switch to tablet notifications when an
out-of-surface-move had been started on a non-tablet
capabale surface.

Also postpone proximity-in when moving to a new surface
with the tip down.
2024-05-27 22:40:50 +02:00
Jens Peters
4b17083aa0 input: close xdg-popups on tablet tip or button press 2024-05-27 22:40:50 +02:00
Jens Peters
caf9c9a599 input: prevent interference between pointer and tablet tool motion
Move the pointer "out of the way" on proximity-in
to prevent interference with tablet motion.
2024-05-27 22:40:50 +02:00
Jens Peters
6d05bed883 config: add option for forcing mouse emulation
Default is off. Also allow switching with reconfigure.
2024-05-27 22:40:50 +02:00
Jens Peters
be72c4bde3 input: support button mapping for tablet capable surfaces
Apply the original mapping to mouse buttons and
map those back to stylus buttons.
2024-05-27 22:40:50 +02:00
Jens Peters
fb57d61f35 input: add tablet-v2 notifications for axis and buttons
Similar like touch, this is guarded by checking if
a surface accepts the tablet protocol. Also reuse
common cursor logic.

Intialize tablet tools on proximity.
Notify idle manager about activity on events.
2024-05-27 22:40:50 +02:00
Jens Peters
abfa100b38 input: add tablet tool setup 2024-05-27 22:40:50 +02:00
Jens Peters
f8a7d18cf0 input: ignore not supported tablet tools
We currently only support cursor emulation
for absolute motion, thus ignore tools/pens
that use relative motion.

Add a log statement on proximity-in to give
some feedback.
2024-05-19 21:21:52 +01:00
Jens Peters
163f11595f input: remove tablet/pad signal listeners on destroy
We should remove those when destroying a tablet
or a tablet pad.

Also rename 'tablet' to 'pad' in 'tablet_pad' for better
readability and consistency.
2024-05-19 21:21:52 +01:00
Jens Peters
6def1319d1 input: move function to config
This function is only about rc, so fits better
in config.
2024-01-22 21:50:18 +00:00
Jens Peters
c2687d9281 input: add tablet pad setup and button handler
Split pad initialization from tablet initialization to
avoid conflicting handler names.
Also reuse 'get_mapped_button'.
2024-01-02 21:28:42 +00:00
Jens Peters
28e7cd3006 input: add area transformation for tablet coordinates 2024-01-01 22:11:33 +00:00
Jens Peters
dd91cd89ae input: log tablet dimensions 2024-01-01 22:11:33 +00:00
Jens Peters
e61e4c4e75 input: add rotate transformation for tablet coordinates
Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
2023-12-29 22:32:41 +00:00
Jens Peters
20bba35570 input: rename drawing_tablet to tablet 2023-12-29 20:22:46 +00:00
Renamed from src/input/drawing_tablet.c (Browse further)