aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorLibravatar Aleksei Bavshin <alebastr89@gmail.com>2023-12-26 22:26:02 -0800
committerLibravatar Ronan Pigott <ronan@rjp.ie>2024-02-17 00:54:30 -0700
commitd19810eba8959f052d91fd6609cef6adf36b3951 (patch)
tree90b727f8cb792b06bf9aa1cc527d254c6c23edbf /sway/tree/view.c
parentlauncher: track the seat in the launcher ctx (diff)
downloadsway-d19810eba8959f052d91fd6609cef6adf36b3951.tar.gz
sway-d19810eba8959f052d91fd6609cef6adf36b3951.tar.zst
sway-d19810eba8959f052d91fd6609cef6adf36b3951.zip
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.
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 5525bf63..4a0d8069 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -412,6 +412,12 @@ void view_request_activate(struct sway_view *view, struct sway_seat *seat) {
412 transaction_commit_dirty(); 412 transaction_commit_dirty();
413} 413}
414 414
415void view_request_urgent(struct sway_view *view) {
416 if (config->focus_on_window_activation != FOWA_NONE) {
417 view_set_urgent(view, true);
418 }
419}
420
415void view_set_csd_from_server(struct sway_view *view, bool enabled) { 421void view_set_csd_from_server(struct sway_view *view, bool enabled) {
416 sway_log(SWAY_DEBUG, "Telling view %p to set CSD to %i", view, enabled); 422 sway_log(SWAY_DEBUG, "Telling view %p to set CSD to %i", view, enabled);
417 if (view->xdg_decoration) { 423 if (view->xdg_decoration) {