labwc/src
Johan Malm a5fcbfaf72 cursor: process layer subsurfaces in cursor_button_press()
...to give keyboard focus to layer-shell clients if exclusive or on-demand
interactivity is set, so that menu popups can be navigated with the
keyboard. This still only works if the client is in top (or overlay)
layers. Support for bottom and background to be done as a separate patch
set.

Revert 06b19f0 to process layer-shell subsurfaces in
`cursor_button_press()`, but only when their parent layer-shell surface
has keyboard interactivity.

Fix bug in `get_cursor_context()` which resulted in layer-surfaces not
being detected correctly.

Background:

Commit 06b19f0 (issue #1131) disabled processing of layer-shell
subsurfaces in cursor_button_press() because when pressing a task in
Waybar (Gtk panel using layer-shell subsurfaces) the foreign-toplevel
minimize-raise action did not work correctly as the action logic relied on
the recipient window being activated and by clicking on the panel, the
panel itself was both surface-focusd and activated (and thus the window
de-activated).

The un-intended consequence was that by not responding to layer-subsurface
cursor buttons presses, layer-shell clients (such as panels) were not
given keyboard focus if they indeed wanted it by setting exclusive or
on-demand keyboard interactivity.

The good news is that that following @jlindgren90's refactoring (various)
the only place where we call `view_set_actived()` is in
`focus_change_notify()` in `seat.c` and we now only do it for views
(bb8f0bc).

Another side-effect (positive) of 06b19f0 was that a Waybar dnd bug was
fixed (pointer-serial-number validation failure).

Have tested with sfwbar, waybar and tint (test-panel) the following
results:
- Minimize-raise works even when on-demand keyboard interactivity is set
- Keyboard interactivity is given popup-menus (sfwbar and tint) when the
  panels are in the top layer (support for bottom will be as a separate
  patch set)
- Waybar dnd still works (even when hard-coding keyboard-interactivity)

References:
- bb8f0bc960
- 40ce95a68c/src/seat.c (L481-L483)
- 40ce95a68c/src/dnd.c (L24)
- https://github.com/johanmalm/tint

Fixes: #1572
2024-03-09 00:44:19 +01:00
..
button string-helpers.c: add string_empty() 2024-01-19 20:00:37 +00:00
common cursor: process layer subsurfaces in cursor_button_press() 2024-03-09 00:44:19 +01:00
config osd: optionally show windows on all workspaces 2024-03-05 22:16:55 +01:00
decorations Chase wlroots: xdg-decoration now references a toplevel 2023-11-27 21:01:53 +00:00
input cursor: process layer subsurfaces in cursor_button_press() 2024-03-09 00:44:19 +01:00
menu Fix various typos across the codebase 2024-03-08 13:59:20 +01:00
ssd src/ssd: ensure we crash properly when compiled without asserts 2024-02-10 19:22:12 +01:00
action.c src/output.c: refactor virtual output related functions 2024-03-07 19:51:54 +00:00
buffer.c theme: create hover button fallbacks 2023-12-21 02:42:23 +01:00
debug.c src/debug.c: detect more scene trees 2024-02-14 21:25:41 +00:00
desktop.c cursor: process layer subsurfaces in cursor_button_press() 2024-03-09 00:44:19 +01:00
dnd.c Remove headers not being used directly 2023-12-22 20:19:39 +00:00
edges.c Fix various typos across the codebase 2024-03-08 13:59:20 +01:00
foreign.c src/view.c: store outputs the view is visible on 2024-02-06 17:23:45 +01:00
idle.c Chase wlroots: drop KDE idle protocol 2023-11-27 21:01:53 +00:00
interactive.c Fix various typos across the codebase 2024-03-08 13:59:20 +01:00
layers.c src/layers.c: delay popup unconstrain until after first commit 2024-02-25 11:49:03 +00:00
main.c session: only update activation environment... 2024-03-04 01:57:32 +01:00
meson.build src/output.c: refactor virtual output related functions 2024-03-07 19:51:54 +00:00
node.c common: Add znew/znew_n() macros 2022-09-18 15:25:19 -04:00
osd.c osd: show preview for windows on other workspaces 2024-03-05 22:16:55 +01:00
output-virtual.c Fix various typos across the codebase 2024-03-08 13:59:20 +01:00
output.c Fix various typos across the codebase 2024-03-08 13:59:20 +01:00
placement.c Fix various typos across the codebase 2024-03-08 13:59:20 +01:00
regions.c Move keyboard functions into input/keyboard.h 2023-10-30 21:14:04 +00:00
resistance.c edges: do not apply resistance to invisible edges 2024-02-14 21:20:45 +00:00
seat.c Fix various typos across the codebase 2024-03-08 13:59:20 +01:00
server.c Add optional headless fallback output 2024-03-08 13:54:13 +01:00
session-lock.c Chase wlroots: use output commit event state 2023-11-27 21:01:53 +00:00
snap.c edges: do not apply resistance to invisible edges 2024-02-14 21:20:45 +00:00
tearing.c Add tearing support (#1390) 2024-01-08 20:58:58 +00:00
theme.c Fix various typos across the codebase 2024-03-08 13:59:20 +01:00
view-impl-common.c Remove headers not being used directly 2023-12-22 20:19:39 +00:00
view.c window-rules: add root-toplevel critiera 2024-03-05 22:16:55 +01:00
window-rules.c Remove headers not being used directly 2023-12-22 20:19:39 +00:00
workspaces.c s/focused_view/active_view/ 2023-12-19 20:34:07 +00:00
xdg-popup.c src/xdg-popup.c: delay popup unconstrain until after first commit 2024-02-25 11:49:03 +00:00
xdg.c Fix various typos across the codebase 2024-03-08 13:59:20 +01:00
xwayland-unmanaged.c xwayland: remove "try to focus on parent surface" logic 2024-03-05 20:51:32 +00:00
xwayland.c view: validate move/resize request from clients 2024-03-07 20:30:50 +00:00