Skip to content

Commit 7d9201c

Browse files
committed
Print wl_surface Enter event
1 parent 5f3a35d commit 7d9201c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

main.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ static const struct xdg_wm_base_listener xdg_wm_base_listener = {
4141
.ping = xdg_wm_base_handle_ping,
4242
};
4343

44+
45+
static void wl_surface_handle_enter(void *data,
46+
struct wl_surface *surface, struct wl_output *output) {
47+
printf("WL_SURFACE ENTER\n");
48+
}
49+
50+
static const struct wl_surface_listener wl_surface_listener = {
51+
.enter = wl_surface_handle_enter,
52+
};
53+
4454
static void xdg_surface_handle_configure(void *data,
4555
struct xdg_surface *xdg_surface, uint32_t serial) {
4656
// The compositor configures our surface, acknowledge the configure event
@@ -167,6 +177,8 @@ static struct wl_buffer *create_buffer(void) {
167177
}
168178

169179
int main(int argc, char *argv[]) {
180+
printf("printf works\n");;
181+
170182
// Connect to the Wayland compositor
171183
struct wl_display *display = wl_display_connect(NULL);
172184
if (display == NULL) {
@@ -193,6 +205,7 @@ int main(int argc, char *argv[]) {
193205
xdg_wm_base_get_xdg_surface(xdg_wm_base, surface);
194206
xdg_toplevel = xdg_surface_get_toplevel(xdg_surface);
195207

208+
wl_surface_add_listener(surface, &wl_surface_listener, NULL);
196209
xdg_surface_add_listener(xdg_surface, &xdg_surface_listener, NULL);
197210
xdg_toplevel_add_listener(xdg_toplevel, &xdg_toplevel_listener, NULL);
198211

0 commit comments

Comments
 (0)