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.
...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
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.
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")
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
- 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.
- Process layer-shell keyboard interactivity in the map and commit
handlers only, rather than in layers_arrange(). This allows handling of
the layer-surface that emitted the event rather than iterating over all
surfaces in the output layer-tree, and therefore avoids having to guess
which surface should have keyboard preference (and it might not be the
last one added to the list which was the assumption previously).
- Prevent seat_focus_surface() from setting keyboard focus if a layer-shell
surface with exclusive keyboard-interactivity has the focus.
- Set cursor_context type for layer-surfaces without node-descriptors
in order to set keyboard focus correctly in cursor_button_press().
Tested satisfactorily with xfce4-panel and gtk-layer-demo.
Fixes#725 and #704
Previously, if rc.xml defined only non-default libinput categories,
no default category was created. This meant that configure_libinput()
might totally skip configuring some devices even with default
settings, like tap-to-click.
Fix this by making sure that a default category is always created.
It seems that every Wayland client is expected to implement its own
key-repeat logic, rather than doing it server-side as in X11. This
means that labwc also has to implement its own key-repeat logic for
compositor keybindings.
This is a very simplistic timer-based implementation. It doesn't
attempt to synthesize accurate timestamps, and may lag depending
on system load, but it appears to get the job done.
v2: Use server->wl_event_loop
v3: Comments and formatting
...so that it can be determined what wlr_keyboard events come from.
This is required to manage virtual keyboards alongside the keyboard_group
of physical keyboards.
Key events associated with keybindings (both pressed and released) are not
sent to clients. When using wlr_seat_keyboard_notify_enter() it it
therefore important not to send the keycodes of _all_ pressed keys, but
only those that were actually _sent_ to clients (that is, those that were
not bound).
This approach is consistent with sway's implementation in input/seat.c
cffb006feb/sway/input/seat.c (L173-L175)
Fixes issue #510
Attempting to open a GTK3 menu and activate a menu item in it,
using a single mouse motion (press-move-release), was broken due
to GTK apparently expecting to receive leave/enter events when the
cursor enters the menu (XDG popup).
To fix the issue, allow leave/enter events when the cursor is
moved between an XDG toplevel and popups of the same.
v2:
- Use (struct view *) as proxy for toplevel in comparisons
- Update seat->pressed.surface when entering/leaving popups
v3:
- Go back to using get_toplevel() rather than (struct view *)