wayland backend:re-attach surface on ExposeRect

This commit is contained in:
Riccardo Canalicchio 2021-10-19 02:10:45 -04:00
parent e7ab056264
commit 1d74e36258
2 changed files with 6 additions and 12 deletions

View file

@ -214,18 +214,14 @@ create_shm_buffer(struct window *window)
NSWarnMLog(@"...cairo initial window error status: %s\n", NSWarnMLog(@"...cairo initial window error status: %s\n",
cairo_status_to_string(cairo_surface_status(_surface))); cairo_status_to_string(cairo_surface_status(_surface)));
} }
window->buffer_needs_attach = YES;
if (window->configured) { if (window->configured) {
if(window->buffer_needs_attach) { window->buffer_needs_attach = NO;
window->buffer_needs_attach = NO; wl_surface_attach(window->surface, window->buffer, 0, 0);
wl_surface_attach(window->surface, window->buffer, 0, 0); wl_surface_damage(window->surface, 0, 0, 1000, 1000);
}
wl_surface_damage(window->surface, 0, 0, width, height);
wl_surface_commit(window->surface); wl_surface_commit(window->surface);
//wl_display_dispatch_pending(window->wlconfig->display); wl_display_dispatch_pending(window->wlconfig->display);
//wl_display_flush(window->wlconfig->display); wl_display_flush(window->wlconfig->display);
} else {
window->buffer_needs_attach = YES;
} }
NSDebugLog(@"[CairoSurface handleExposeRect end]"); NSDebugLog(@"[CairoSurface handleExposeRect end]");

View file

@ -1164,8 +1164,6 @@ int NSToWayland(struct window *window, int ns_y)
xdg_wm_base_get_xdg_surface(wlconfig->wm_base, window->surface); xdg_wm_base_get_xdg_surface(wlconfig->wm_base, window->surface);
window->toplevel = xdg_surface_get_toplevel(window->xdg_surface); window->toplevel = xdg_surface_get_toplevel(window->xdg_surface);
xdg_surface_add_listener(window->xdg_surface,
&xdg_surface_listener, window);
xdg_surface_add_listener(window->xdg_surface, xdg_surface_add_listener(window->xdg_surface,
&xdg_surface_listener, window); &xdg_surface_listener, window);