]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xwayland: handle unmanaged activate requests
authorJohan Malm <jgm323@gmail.com>
Wed, 19 Apr 2023 09:14:51 +0000 (10:14 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 19 Apr 2023 13:30:54 +0000 (14:30 +0100)
src/xwayland-unmanaged.c

index 39b221c09768ea1497327ee62e577812be0dfc01..a26a8f7d3c7652221b0fd51f14d0e6a2fec53d4b 100644 (file)
@@ -158,7 +158,15 @@ unmanaged_handle_override_redirect(struct wl_listener *listener, void *data)
 static void
 unmanaged_handle_request_activate(struct wl_listener *listener, void *data)
 {
-       wlr_log(WLR_DEBUG, "request_activate not handled\n");
+       wlr_log(WLR_DEBUG, "handle unmanaged request_activate");
+       struct wlr_xwayland_surface *xsurface = data;
+       if (!xsurface->mapped) {
+               return;
+       }
+       struct xwayland_unmanaged *unmanaged = xsurface->data;
+       struct server *server = unmanaged->server;
+       struct seat *seat = &server->seat;
+       seat_focus_surface(seat, xsurface->surface);
 }
 
 void
@@ -168,6 +176,7 @@ xwayland_unmanaged_create(struct server *server,
        struct xwayland_unmanaged *unmanaged = znew(*unmanaged);
        unmanaged->server = server;
        unmanaged->xwayland_surface = xsurface;
+       xsurface->data = unmanaged;
 
        wl_signal_add(&xsurface->events.request_configure,
                &unmanaged->request_configure);