aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorLibravatar Robin Jarry <robin@jarry.cc>2023-01-25 21:54:16 +0100
committerLibravatar Ronan Pigott <ronan@rjp.ie>2023-02-22 11:41:43 -0700
commit9498e4d2614fce6b29b64fd8a3861c1fb5be4b87 (patch)
tree68c572ccf83b868bece2443ed6fd95b8831558ad /sway/tree/view.c
parentCheck for empty damage before attaching render buffer (diff)
downloadsway-9498e4d2614fce6b29b64fd8a3861c1fb5be4b87.tar.gz
sway-9498e4d2614fce6b29b64fd8a3861c1fb5be4b87.tar.zst
sway-9498e4d2614fce6b29b64fd8a3861c1fb5be4b87.zip
Allow windows in scratchpad to set the urgent flag
When a window in the scratchpad container requests for xdg_activation_v1, it is ignored no matter what the value of focus_on_window_activation is. At least allow windows in the scratchpad to set the urgent flag. When focus_on_window_activation is set to "focus", show the parent scratchpad where the contained requested for xdg_activation_v1.
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index fcb78de3..ec54fed8 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -369,16 +369,13 @@ void view_set_activated(struct sway_view *view, bool activated) {
369 369
370void view_request_activate(struct sway_view *view, struct sway_seat *seat) { 370void view_request_activate(struct sway_view *view, struct sway_seat *seat) {
371 struct sway_workspace *ws = view->container->pending.workspace; 371 struct sway_workspace *ws = view->container->pending.workspace;
372 if (!ws) { // hidden scratchpad container
373 return;
374 }
375 if (!seat) { 372 if (!seat) {
376 seat = input_manager_current_seat(); 373 seat = input_manager_current_seat();
377 } 374 }
378 375
379 switch (config->focus_on_window_activation) { 376 switch (config->focus_on_window_activation) {
380 case FOWA_SMART: 377 case FOWA_SMART:
381 if (workspace_is_visible(ws)) { 378 if (ws && workspace_is_visible(ws)) {
382 seat_set_focus_container(seat, view->container); 379 seat_set_focus_container(seat, view->container);
383 container_raise_floating(view->container); 380 container_raise_floating(view->container);
384 } else { 381 } else {
@@ -389,8 +386,12 @@ void view_request_activate(struct sway_view *view, struct sway_seat *seat) {
389 view_set_urgent(view, true); 386 view_set_urgent(view, true);
390 break; 387 break;
391 case FOWA_FOCUS: 388 case FOWA_FOCUS:
392 seat_set_focus_container(seat, view->container); 389 if (container_is_scratchpad_hidden_or_child(view->container)) {
393 container_raise_floating(view->container); 390 root_scratchpad_show(view->container);
391 } else {
392 seat_set_focus_container(seat, view->container);
393 container_raise_floating(view->container);
394 }
394 break; 395 break;
395 case FOWA_NONE: 396 case FOWA_NONE:
396 break; 397 break;