aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2023-12-26 22:26:02 -0800
committerFurkan Sahin <furkan-dev@proton.me>2023-12-26 22:26:02 -0800
commit7e4bb1a0a412fa59dd0b1c8dcb57afc07056ccee (patch)
tree444def96b49e543cde88272456b108aed3df2847 /include
parent9493c53cfcec073fcc74b86aac52f69bc4f53da5 (diff)
xdg-activation: distinguish activation and urgency requests
Check if the app that requested a token has provided a valid input serial and a focused surface. Downgrade activation request to urgency otherwise. This is mostly in line with what other Wayland compositors decided to do, and offers a better security than the original logic. (cherry picked from commit d19810eba8959f052d91fd6609cef6adf36b3951)
Diffstat (limited to 'include')
-rw-r--r--include/sway/desktop/launcher.h1
-rw-r--r--include/sway/tree/view.h5
2 files changed, 6 insertions, 0 deletions
diff --git a/include/sway/desktop/launcher.h b/include/sway/desktop/launcher.h
index ad465a9e..412068a9 100644
--- a/include/sway/desktop/launcher.h
+++ b/include/sway/desktop/launcher.h
@@ -14,6 +14,7 @@ struct launcher_ctx {
struct wl_listener seat_destroy;
bool activated;
+ bool had_focused_surface;
struct sway_node *node;
struct wl_listener node_destroy;
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index 960f9d71..c0e5ad9b 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -277,6 +277,11 @@ void view_set_activated(struct sway_view *view, bool activated);
*/
void view_request_activate(struct sway_view *view, struct sway_seat *seat);
+/*
+ * Called when the view requests urgent state
+ */
+void view_request_urgent(struct sway_view *view);
+
/**
* If possible, instructs the client to change their decoration mode.
*/