Fix window hide/show() using withdrawn_set() 62/13462/2 accepted/tizen/20131212.180615 accepted/tizen/ivi/20131218.012005 accepted/tizen/mobile/20131216.220251 submit/tizen/20131211.213933 submit/tizen/20131218.003013
authorManuel Bachmann <manuel.bachmann@eurogiciel.fr>
Thu, 5 Dec 2013 16:50:58 +0000 (17:50 +0100)
committerManuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Fri, 6 Dec 2013 14:56:02 +0000 (15:56 +0100)
Bug-Tizen: https://bugs.tizen.org/jira/browse/TIVI-2048
Bug-Upstream: https://phab.enlightenment.org/T155

Co-Authored-by: Rafael Antognolli <rafael.antognolli@intel.com>
Change-Id: Ic43bf06fa619cc6c94054f2e39ac31d2e2eab431
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
src/modules/engines/wayland_egl/evas_engine.c
src/modules/engines/wayland_egl/evas_wl_main.c

index a50dac0..c32223e 100644 (file)
@@ -715,20 +715,6 @@ eng_setup(Evas *e, void *in)
                {
                   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,
@@ -824,8 +810,6 @@ eng_setup(Evas *e, void *in)
 
    // This is used in extensions.  Not pretty but can't get display otherwise.
    current_engine = re;
-
-   return 1;
 }
 
 static void
index 1a2886f..6a01e29 100644 (file)
@@ -217,25 +217,28 @@ eng_window_free(Evas_GL_Wl_Window *gw)
    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);
 }