@@ -41,6 +41,16 @@ static const struct xdg_wm_base_listener xdg_wm_base_listener = {
41
41
.ping = xdg_wm_base_handle_ping ,
42
42
};
43
43
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
+
44
54
static void xdg_surface_handle_configure (void * data ,
45
55
struct xdg_surface * xdg_surface , uint32_t serial ) {
46
56
// The compositor configures our surface, acknowledge the configure event
@@ -167,6 +177,8 @@ static struct wl_buffer *create_buffer(void) {
167
177
}
168
178
169
179
int main (int argc , char * argv []) {
180
+ printf ("printf works\n" );;
181
+
170
182
// Connect to the Wayland compositor
171
183
struct wl_display * display = wl_display_connect (NULL );
172
184
if (display == NULL ) {
@@ -193,6 +205,7 @@ int main(int argc, char *argv[]) {
193
205
xdg_wm_base_get_xdg_surface (xdg_wm_base , surface );
194
206
xdg_toplevel = xdg_surface_get_toplevel (xdg_surface );
195
207
208
+ wl_surface_add_listener (surface , & wl_surface_listener , NULL );
196
209
xdg_surface_add_listener (xdg_surface , & xdg_surface_listener , NULL );
197
210
xdg_toplevel_add_listener (xdg_toplevel , & xdg_toplevel_listener , NULL );
198
211
0 commit comments