{
int inc = 0;
- /* if we already have a window surface, check for NULL input surface.
- * this will mean we are hiding the window and should destroy
- * things properly */
- if ((re->win->surface) && (re->info->info.surface == NULL))
- {
- if (re->win)
- {
- eng_window_free(re->win);
- gl_wins--;
- re->win = NULL;
- }
- return 1;
- }
-
new_win = eng_window_new(re->info->info.display,
re->info->info.surface,
re->info->info.screen,
// This is used in extensions. Not pretty but can't get display otherwise.
current_engine = re;
-
- return 1;
}
static void
win_count--;
eng_window_use(gw);
if (gw == _evas_gl_wl_window) _evas_gl_wl_window = NULL;
-// if (gw->win) wl_egl_window_destroy(gw->win);
+
if (gw->gl_context)
{
ref = gw->gl_context->references - 1;
evas_gl_common_context_free(gw->gl_context);
}
- if (gw->egl_surface[0] != EGL_NO_SURFACE)
- eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- if (gw->egl_context[0] != EGL_NO_CONTEXT && gw->egl_context[0] != share_context)
+ if (gw->egl_context[0] != share_context)
eglDestroyContext(gw->egl_disp, gw->egl_context[0]);
+ if (gw->egl_surface[0] != EGL_NO_SURFACE)
+ eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
+
+ if (gw->win) wl_egl_window_destroy(gw->win);
+
if (ref == 0)
{
- /* NB: This is causing an unknown hang when we run elm apps as
- * wayland clients inside the weston compositor */
- /* eglTerminate(gw->egl_disp); */
+ if (share_context) eglDestroyContext(gw->egl_disp, share_context);
+ eglTerminate(gw->egl_disp);
eglReleaseThread();
+ share_context = EGL_NO_CONTEXT;
}
free(gw);
}