Commit graph

14 commits

Author SHA1 Message Date
John Lindgren
d2ce31fcc9 tree-wide: use forward declarations for wlr types 2025-09-07 19:34:30 +09:00
John Lindgren
d14f5ca228 ssd: update comments referencing ssd_part/ssd_part_type 2025-09-06 16:00:20 -04:00
John Lindgren
1188534876 common: add node-type.c/h (renaming ssd_part_type to lab_node_type)
ssd_part_type contains several node types that are not actually part of
server-side decorations (ROOT, MENU, OSD, etc.)

Rename it accordingly and move it to a common location, along with some
related conversion/comparison functions.
2025-09-06 16:00:20 -04:00
John Lindgren
ef766d16f0 common: flesh out enum lab_edge and prefer over wlr_edges/wlr_direction
I like the new common/edge.h. I don't like how inconsistently we use it.

Current situation:

 - enum wlr_edges and wlr_direction are designed to be used as bitset,
   and are defined compatibly

 - enum lab_edge is *also* designed to be used as bitset, but
   incompatible with the others (LEFT/RIGHT come before UP/DOWN)

 - we use an inconsistent mix of all three *AND* uint32_t (usually with
   the WLR_EDGE constants rather than the LAB_EDGE constants), and
   convert between them on an ad-hoc basis, sometimes implicitly

Let's clean this up:

 - reorder enum lab_edge to be compatible with the two wlr enums
   (check this by static_assert)

 - use TOP/BOTTOM naming rather than UP/DOWN (matches wlr_edges)

 - add constants for the remaining possible combinations of the 4 edges

 - use lab_edge for all internal edge/direction fields, consistently

 - add lab_edge_is_cardinal() as a sanity check before casting to
   enum wlr_direction, and then eliminate all of direction.c/h

Instead of "enum wlr_edges direction", we now have
"enum lab_edge direction" which is not that much better. At least we
are now clear that we're overloading one enum with two meanings.
2025-08-26 20:36:43 -04:00
Jens Peters
829fedb94a cursor: introduce cursor_emulate_axis() 2025-05-07 03:47:37 +09:00
Jens Peters
fc774d0071 input: hide cursor when using touch input
Hide the cursor on touch input and keep the cursur invisible
until pointer or tablet input.
2024-11-10 17:08:38 +09:00
tokyo4j
1557cb774f cursor: prevent Drag mousebinds from running without button press
For `Drag` mousebinds, `pressed_in_context` is set by
`cursor_process_button_press()` and cleared by `cursor_process_motion()`
which runs actions bound to them. However, when `cursor_process_motion()`
is called while interactive move/resize, it doesn't clear
`pressed_in_context` due to the early-return and the `Drag` mousebinds are
unexpectedly executed on another call to `cursor_process_motion()` after
the interactive move/resize is finished by button release, even when the
button is not pressed.

So this commit fixes it by always clearing `pressed_in_context` on button
releases.
2024-10-01 21:26:19 +01:00
Jens Peters
ba9de228e0 input: add relative cursor move emulation 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
634a2beb31 input: expose general cursor motion and button functions
Separate the general logic from the pointer notifications
to allow reuse of those function for other (e.g. tablet)
input sources.
2024-05-27 22:40:50 +02:00
Consolatis
8d4f295440 cursor: reload cursor on Reconfigure
This gives instant feedback when changing cursor theme or size.
It only works for server side cursors or clients using the
cursor-shape protocol.

Fixes: #1619
2024-05-04 21:28:10 +01:00
Simon Long
1e1e90d0bb
Reload cursor theme and size on reconfigure
Fixes: #1587
2024-03-12 20:53:41 +01:00
Jens Peters
58e9724007 input: add cursor move and button emulation
Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
2023-12-27 11:09:26 +00:00
Consolatis
67a8ae8561 Move input related source files into src/input/ 2023-10-30 21:14:04 +00:00
Renamed from include/cursor.h (Browse further)