Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions hwcomposer/wayland-hwc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
}
}

Expand Down Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions hwcomposer/wayland-hwc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -128,6 +129,7 @@ struct display {
struct wl_surface *tablet_surface;
std::list<struct zwp_tablet_tool_v2 *> tablet_tools;
std::map<struct zwp_tablet_tool_v2 *, uint16_t> tablet_tools_evt;
std::string xdg_activation_token;

int width;
int height;
Expand Down