[wayland_xdg_egl] add initial commit for wl_surface after setting xdg_surface states

main
Allen Webster 2026-02-25 16:34:05 -08:00
parent 65ae8b4b40
commit 60166e6861
2 changed files with 16 additions and 2 deletions

View File

@ -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 "
*/

View File

@ -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");
}