From b94d44502d281137e72b16c6c21a271a02dda69c Mon Sep 17 00:00:00 2001 From: Alessandro Astone Date: Fri, 9 Sep 2022 17:35:44 +0200 Subject: [PATCH] [WIP] hwcomposer: Implement xdg_activation_v1 --- hwcomposer/wayland-hwc.cpp | 12 ++++++++++++ hwcomposer/wayland-hwc.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/hwcomposer/wayland-hwc.cpp b/hwcomposer/wayland-hwc.cpp index 3ec96881..7c8bbc44 100644 --- a/hwcomposer/wayland-hwc.cpp +++ b/hwcomposer/wayland-hwc.cpp @@ -65,6 +65,7 @@ #include "presentation-time-client-protocol.h" #include "xdg-shell-client-protocol.h" #include "tablet-unstable-v2-client-protocol.h" +#include "xdg-activation-v1-client-protocol.h" using ::android::hardware::hidl_string; @@ -1606,6 +1607,13 @@ registry_handle_global(void *data, struct wl_registry *registry, &zwp_tablet_manager_v2_interface, 1); if (d->tablet_manager && d->seat) add_tablet_seat(d); + } else if (strcmp(interface, "xdg_activation_v1") == 0) { + char token[PROPERTY_VALUE_MAX]; + if (property_get("waydroid.xdg_activation_token", token, nullptr) > 0) { + d->xdg_activation_token = token; + d->xdg_activation = (struct xdg_activation_v1 *)wl_registry_bind(registry, id, + &xdg_activation_v1_interface, 1); + } } } @@ -1685,6 +1693,10 @@ destroy_display(struct display *display) zwp_tablet_manager_v2_destroy(display->tablet_manager); } + if (display->xdg_activation) { + xdg_activation_v1_destroy(display->xdg_activation); + } + wl_registry_destroy(display->registry); wl_display_flush(display->display); wl_display_disconnect(display->display); diff --git a/hwcomposer/wayland-hwc.h b/hwcomposer/wayland-hwc.h index 849b5860..467583aa 100644 --- a/hwcomposer/wayland-hwc.h +++ b/hwcomposer/wayland-hwc.h @@ -106,6 +106,7 @@ struct display { struct xdg_wm_base *wm_base; struct zwp_tablet_manager_v2* tablet_manager; struct zwp_tablet_seat_v2 *tablet_seat; + struct xdg_activation_v1 *xdg_activation; int gtype; int scale; pthread_mutex_t data_mutex; @@ -128,6 +129,7 @@ struct display { struct wl_surface *tablet_surface; std::list tablet_tools; std::map tablet_tools_evt; + std::string xdg_activation_token; int width; int height;