aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConsolatis <40171-Consolatis@users.noreply.gitlab.freedesktop.org>2023-02-06 15:27:04 +0100
committerConsolatis <40171-Consolatis@users.noreply.gitlab.freedesktop.org>2023-02-06 15:52:02 +0100
commitf6008ffff41f67e3c20bd8b3be8f216da6a4bb30 (patch)
tree7544f73f72b9e7bfb41dca33ab4c8e3d79d8bbae
parent7b32c25a4fbdcde4197a06c8e0ff638c54753bd7 (diff)
downloadwlroots-f6008ffff41f67e3c20bd8b3be8f216da6a4bb30.tar.xz
xdg-activation: accept pointer focus for new tokens
This patch allows surfaces without keyboard focus but with pointer focus to receive valid tokens. This can be relevant for applications using an older version of the layershell protocol which only provided the choice between no keyboard focus and exclusive keyboard focus.
-rw-r--r--types/wlr_xdg_activation_v1.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/types/wlr_xdg_activation_v1.c b/types/wlr_xdg_activation_v1.c
index c04827bf..74ac0a8e 100644
--- a/types/wlr_xdg_activation_v1.c
+++ b/types/wlr_xdg_activation_v1.c
@@ -115,9 +115,10 @@ static void token_handle_commit(struct wl_client *client,
}
if (token->surface != NULL &&
- token->surface != token->seat->keyboard_state.focused_surface) {
+ token->surface != token->seat->keyboard_state.focused_surface &&
+ token->surface != token->seat->pointer_state.focused_surface) {
wlr_log(WLR_DEBUG, "Rejecting token commit request: "
- "surface doesn't have keyboard focus");
+ "surface doesn't have focus");
goto error;
}
}