]> git.mdlowis.com Git - proto/labwc.git/commitdiff
workspaces: Switch workspace when activating via panel
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 15 Jun 2022 20:49:36 +0000 (22:49 +0200)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 15 Jun 2022 20:49:39 +0000 (22:49 +0200)
src/foreign.c

index 93e76b3a27a3affa8723bc546cd9fc1b34919c1b..658dca32d8c4cf4c4f84414f8e293ef7adb3ffe9 100644 (file)
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include "labwc.h"
+#include "workspaces.h"
 
 static void
 handle_toplevel_handle_request_minimize(struct wl_listener *listener, void *data)
@@ -42,6 +43,9 @@ handle_toplevel_handle_request_activate(struct wl_listener *listener, void *data
        // struct wlr_foreign_toplevel_handle_v1_activated_event *event = data;
        /* In a multi-seat world we would select seat based on event->seat here. */
        if (view) {
+               if (view->workspace != view->server->workspace_current) {
+                       workspaces_switch_to(view->workspace);
+               }
                desktop_focus_and_activate_view(&view->server->seat, view);
                desktop_move_to_front(view);
        }