diff --git a/wayland_xdg_egl.c b/wayland_xdg_egl.c index 8f40c05..baedba3 100755 --- a/wayland_xdg_egl.c +++ b/wayland_xdg_egl.c @@ -405,9 +405,23 @@ int main(){ /* [1] */ xdg_toplevel_add_listener(ctx.xdg_toplevel, &xdg_toplevel_listener, NULL); + + /* (2) xdg_surface + ** " After creating a role-specific object and setting it up (e.g. by sending + ** the title, app ID, size constraints, parent, etc), the client must perform + ** an initial commit without any buffer attached. The compositor will reply + ** with initial wl_surface state such as wl_surface.preferred_buffer_scale + ** followed by an xdg_surface.configure event. The client must acknowledge + ** it and is then allowed to attach a buffer to map the surface. " + ** + **~NOTE: The "without any buffer attached" here literally translates to + ** "before eglCreateWindowSurface" which does the actual buffer attachment + ** (at least based on my testing - citation needed) + */ + wl_surface_commit(ctx.wl_surface); } - if (ctx.xdg_surface != 0){ + if (ctx.xdg_toplevel != 0){ /* (1) Appendix A: wl_compositor::create_region ** " create new region " */ diff --git a/x11_egl.c b/x11_egl.c index 0e11dc3..1c690e9 100755 --- a/x11_egl.c +++ b/x11_egl.c @@ -239,7 +239,7 @@ int main(int argc, char **argv){ */ EGLBoolean swap_interval_success = 0; if (make_current_success2){ - swap_interval_success = eglSwapInterval(ctx.egl_display, 1); + swap_interval_success = eglSwapInterval(egl_display, 1); if (!swap_interval_success){ printf("eglSwapInterval failed\n"); }