File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -725,12 +725,6 @@ void Wayland_ShowWindow(_THIS, SDL_Window *window)
725725 SDL_VideoData * c = _this -> driverdata ;
726726 SDL_WindowData * data = window -> driverdata ;
727727
728- /* Detach any previous buffers before resetting everything, otherwise when
729- * calling this a second time you'll get an annoying protocol error
730- */
731- wl_surface_attach (data -> surface , NULL , 0 , 0 );
732- wl_surface_commit (data -> surface );
733-
734728 /* Create the shell surface and map the toplevel */
735729#ifdef HAVE_LIBDECOR_H
736730 if (c -> shell .libdecor ) {
@@ -862,6 +856,10 @@ void Wayland_HideWindow(_THIS, SDL_Window *window)
862856 wind -> shell_surface .xdg .surface = NULL ;
863857 }
864858 }
859+
860+ /* Be sure to detach after this is done, otherwise ShowWindow crashes! */
861+ wl_surface_attach (wind -> surface , NULL , 0 , 0 );
862+ wl_surface_commit (wind -> surface );
865863}
866864
867865static void
You can’t perform that action at this time.
0 commit comments