Skip to content

Commit b94d445

Browse files
committed
[WIP] hwcomposer: Implement xdg_activation_v1
1 parent 7fdaf9d commit b94d445

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

hwcomposer/wayland-hwc.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
#include "presentation-time-client-protocol.h"
6666
#include "xdg-shell-client-protocol.h"
6767
#include "tablet-unstable-v2-client-protocol.h"
68+
#include "xdg-activation-v1-client-protocol.h"
6869

6970
using ::android::hardware::hidl_string;
7071

@@ -1606,6 +1607,13 @@ registry_handle_global(void *data, struct wl_registry *registry,
16061607
&zwp_tablet_manager_v2_interface, 1);
16071608
if (d->tablet_manager && d->seat)
16081609
add_tablet_seat(d);
1610+
} else if (strcmp(interface, "xdg_activation_v1") == 0) {
1611+
char token[PROPERTY_VALUE_MAX];
1612+
if (property_get("waydroid.xdg_activation_token", token, nullptr) > 0) {
1613+
d->xdg_activation_token = token;
1614+
d->xdg_activation = (struct xdg_activation_v1 *)wl_registry_bind(registry, id,
1615+
&xdg_activation_v1_interface, 1);
1616+
}
16091617
}
16101618
}
16111619

@@ -1685,6 +1693,10 @@ destroy_display(struct display *display)
16851693
zwp_tablet_manager_v2_destroy(display->tablet_manager);
16861694
}
16871695

1696+
if (display->xdg_activation) {
1697+
xdg_activation_v1_destroy(display->xdg_activation);
1698+
}
1699+
16881700
wl_registry_destroy(display->registry);
16891701
wl_display_flush(display->display);
16901702
wl_display_disconnect(display->display);

hwcomposer/wayland-hwc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ struct display {
106106
struct xdg_wm_base *wm_base;
107107
struct zwp_tablet_manager_v2* tablet_manager;
108108
struct zwp_tablet_seat_v2 *tablet_seat;
109+
struct xdg_activation_v1 *xdg_activation;
109110
int gtype;
110111
int scale;
111112
pthread_mutex_t data_mutex;
@@ -128,6 +129,7 @@ struct display {
128129
struct wl_surface *tablet_surface;
129130
std::list<struct zwp_tablet_tool_v2 *> tablet_tools;
130131
std::map<struct zwp_tablet_tool_v2 *, uint16_t> tablet_tools_evt;
132+
std::string xdg_activation_token;
131133

132134
int width;
133135
int height;

0 commit comments

Comments
 (0)