Commit graph

107 commits

Author SHA1 Message Date
tokyo4j
50fd65416f overlay: add theme setting snapping.preview.[region|edge].fill
This settings allows user to choose whether to draw a filled rectangle
or an outlined rectangle as the preview for window snapping.
2024-04-15 12:33:40 +02:00
SnowNF
fb921ab431 Optimize the code based on the suggestions 2024-03-20 22:52:19 +00:00
SnowNF
bd4d92bad8 libinput: add support for touchscreen set matrix
My android pad emit a strange touch input from libinput, need to rotate it in 270 degree clockwise to fix.
2024-03-20 22:52:19 +00:00
Johan Malm
045dd8a378 seat: remove unecessary top/overlay check in seat_set_focus_layer()
Such checks should be made prior to calling the function (which they
are).
2024-03-17 21:18:47 +00:00
Johan Malm
5cb3583108 keyboard: use 'us' as fallback for XKB_DEFAULT_LAYOUT
...if keymap cannot be created for the provided XKB_DEFAULT_LAYOUT.

If keymap still cannot be created, exit with a helpful message to avoid
crash that is hard to understand.

Fixes: https://github.com/stefonarch/lxqt-labwc-session/issues/7
2024-03-12 20:59:39 +00:00
Simon Long
1e1e90d0bb
Reload cursor theme and size on reconfigure
Fixes: #1587
2024-03-12 20:53:41 +01:00
Hiroaki Yamamoto
be37f9a564
Fix various typos across the codebase 2024-03-08 13:59:20 +01:00
John Lindgren
bb8f0bc960 seat: don't deactivate view for any non-view surface
Now we now longer gray-out the active window when opening a focusable
popup menu (e.g. the applications menu from an XWayland panel). This
matches Openbox behavior.
2024-03-05 20:51:32 +00:00
tokyo4j
334cd09106 IME: support input method 2024-03-05 20:28:15 +00:00
Sachin Bhat
6fb06c54c2 config: support libinput sendEventsMode
This allows to enable / disable libinput devices.

Co-Authored-By: @Consolatis
2024-02-24 21:36:53 +01:00
Jens Peters
9456b50983 seat: fix configure condition for click method
Exclude none (zero) from the bitmask test , otherwise
the bitmask test is always true when click method is
configured to 'none' and as a result the configuration
will be skipped.
2024-02-24 20:39:54 +01:00
Marvin Dostal
8be9c38460
Add click method libinput option (#1416)
<libinput>
  <device>
    <clickMethod>none|buttonAreas|clickfinger</clickMethod>
  </device>
</libinput>
2024-02-21 17:19:48 +00:00
Consolatis
a5c6b2f83d Prevent 'unused variable' warnings when compiled without asserts 2024-02-10 19:22:12 +01:00
Consolatis
e9552fb661 src/seat.c: provide NULL fallback for output name
This fixes a warning when doing a release build.
2024-02-10 19:22:12 +01:00
Jens Peters
1d4961650f seat: re-map pointer to output on reconfigure
Makes testing easier, also consistent with other
devices types on reconfigure.
2024-01-22 21:50:18 +00:00
Jens Peters
19cab55092 seat: get output name from touch config for current device
The output name attached to the touch device has
still priority.
2024-01-22 21:50:18 +00:00
Jens Peters
2c3ab16f39 config: parse multiple touch configurations
Also temporary disable touch output mapping.
Will be restored later.
2024-01-22 21:50:18 +00:00
Simon Long
8c9be2f0d1 keyboard: set keyboard layout on reconfigure
If keyboard-layout-per-toplevel-window is used, reset the group (index)
for each window on --reconfigure whenever the keymap has changed.

Refactor to use a common configure function for reconfigure and
keyboard-group creation.

Co-authored-by: @johanmalm

Fixes #1407
2024-01-19 18:59:14 +00:00
Jens Peters
6d6f243ff5 seat: re-map pointer to output on output change 2024-01-13 22:18:20 +00:00
Jens Peters
f5f5a7b036 seat: configure libinput for touch on reconfigure 2024-01-13 22:18:20 +00:00
Jens Peters
ffc4b0fdee seat: remove not needed device type test
The device type is already validated in the calling
function.
2024-01-13 22:18:20 +00:00
Jens Peters
516423f9ba seat: re-map touch to output on output change 2024-01-13 22:18:20 +00:00
Jens Peters
0eb1ae4d66 seat: re-map touch to output on reconfigure 2024-01-13 22:18:20 +00:00
Jens Peters
21cf3071e3 seat: map touch to configured output name
The output name linked to the touch device
has preference when set. This happens when
the compositor runs in nested mode.
2024-01-13 22:18:20 +00:00
Jens Peters
17e15ed987 seat: re-map tablet to output on output change 2024-01-10 21:10:11 +00:00
Jens Peters
8de5d7e653 seat: re-map tablet to output on reconfigure 2024-01-10 21:10:11 +00:00
Jens Peters
354c5cf967 seat: map tablet to output on init 2024-01-10 21:10:11 +00:00
Jens Peters
80075df0b7 seat: extract function 2024-01-10 21:10:11 +00:00
Jens Peters
cef2214023 seat: change order
More in line with other functions.
2024-01-10 21:10:11 +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
Johan Malm
af5d80a583 config: s/enum device_type/enum lab_libinput_device_type/ 2024-01-01 22:04:21 +00:00
Johan Malm
673c745cff config: prefix enums with LAB_LIBINPUT_DEVICE_ 2024-01-01 22:04:21 +00:00
Johan Malm
a7f8eef163 seat: refactor obtaining libinput category for device
No functional change intended.
2024-01-01 22:04:21 +00:00
Johan Malm
94cec51d9f config: use wl_list_append() for libinput categories
...to make it more intuitive.

Also, do not check for existance of name when type==DEFAULT because name
will only exist when type==NONE.
2024-01-01 22:04:21 +00:00
Jens Peters
20bba35570 input: rename drawing_tablet to tablet 2023-12-29 20:22:46 +00:00
Jared Baur
6faee17d20 Add touchpad device type
It is nice to have finer granularity for device types to allow for
configurations such as using `naturalScroll` on touchpads, but not on
regular pointer devices such as mice.
2023-12-29 08:08:32 +00:00
Jens Peters
605f9e9181 seat: initialize tablet tool or pad
Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
2023-12-27 11:09:26 +00:00
Johan Malm
6a2a52c0ad seat: do not update active_view on layer-shell keyboard focus
...because layer-shell clients are not views and we want to be able to
use foreign-toplevel protocol on the active view even if a client such as
a panel has taken keyboard focus.

Written-by: @Consolatis

Fixes: #1336
2023-12-19 20:34:07 +00:00
Johan Malm
3a959cc74b s/focused_view/active_view/ 2023-12-19 20:34:07 +00:00
Consolatis
797e743c8a Move input handler init() and finish() functions to input/input.c 2023-10-30 21:14:04 +00:00
Consolatis
b359b1560c Move keyboard functions into input/keyboard.h 2023-10-30 21:14:04 +00:00
Consolatis
5e1562fae6 Make touch depend on cursor to prevent racing 2023-10-30 21:14:04 +00:00
Consolatis
67a8ae8561 Move input related source files into src/input/ 2023-10-30 21:14:04 +00:00
John Lindgren
8bb2e2123f seat: move session-lock check down to seat_focus() level
We were checking for a locked session in desktop_focus_view(), but there
are several other call sites of seat_focus_surface() which were missing
such a check. Any one of those could cause the lock screen to lose focus
(making the session impossible to unlock) or another surface to gain it
(breaching the session lock).

To fix the issue, make any call to seat_focus_surface() no-op when the
session is locked. Add a specific seat_focus_lock_surface() function
which is the only way to bypass the check and is called only from
session-lock.c.
2023-10-15 21:32:41 +01:00
John Lindgren
5c4038493f view: add view_is_related()
Allows removing xwayland-specific stuff from seat.c.

Based on a suggestion from @Consolatis.

v2: add comments
2023-10-15 18:38:47 +02:00
John Lindgren
259d6d0c71 seat: ignore focus change to unmanaged surface belonging to same PID
If an xwayland-unmanaged surface was focused belonging to the same
application as the focused view, allow the view to remain active. This
fixes an issue with menus immediately closing in some X11 apps (try
LibreOffice with SAL_USE_VCLPLUGIN=gen).

Fixes: 4028a9482f
("seat: use focus_change event to update focused/active view")
2023-10-14 13:38:19 -04:00
John Lindgren
ecad76560e keyboard: add option to enable Num Lock automatically (default=enabled)
Co-authored-by: @Consolatis
2023-10-09 20:48:03 +01:00
John Lindgren
7e72bf975f view/xwayland: avoid focusing views that don't want focus
XWayland views can self-declare that they don't want keyboard focus via
the ICCCM WM_HINTS property. Most of the logic is already in place to
avoid giving focus to such views (e.g. taskbars).

Add a couple of missing pieces to make this work:

- Hook up view_isfocusable() to look at WM_HINTS for XWayland views
- Adjust desktop_focus_topmost_mapped_view() to skip unfocusable views
2023-09-29 18:04:32 +01:00
John Lindgren
4028a9482f seat: use focus_change event to update focused/active view
- Connect to wlr_seat_keyboard_state's focus_change event.
- Add view_from_wlr_surface(), which does what the name says.
- Use focus_change event along with view_from_wlr_surface() to update
  server->focused_view and set SSD states via view_set_activated().
- Eliminate desktop_focused_view() since server->focused_view should be
  reliably up-to-date now.
- Eliminate view_focus/defocus() since we can now just call
  seat_focus_surface() directly.
2023-09-28 22:52:30 +01:00
tokyo4j
3c3656f74e config: support <tapAndDrag> and <dragLock> 2023-09-07 22:55:50 +01:00