ecore_wl2: Silence a commit ERR on window hide
authorDerek Foreman <derekf@osg.samsung.com>
Fri, 16 Mar 2018 17:47:05 +0000 (12:47 -0500)
committerWonki Kim <wonki_.kim@samsung.com>
Tue, 10 Apr 2018 11:21:58 +0000 (20:21 +0900)
Cosmetic fix, should be functionally identical.  Hide can be called
asynchronously, so it's ok, and the ERR can be silenced.

src/lib/ecore_wl2/ecore_wl2_window.c

index a294d34..e53c46f 100644 (file)
@@ -1181,6 +1181,19 @@ ecore_wl2_window_hide(Ecore_Wl2_Window *window)
    EINA_INLIST_FOREACH_SAFE(window->subsurfs, tmp, subsurf)
      _ecore_wl2_subsurf_unmap(subsurf);
 
+   if (window->commit_pending)
+     {
+        /* We've probably been hidden while an animator
+         * is ticking.  Cancel the callback.
+         */
+        window->commit_pending = EINA_FALSE;
+        if (window->callback)
+          {
+             wl_callback_destroy(window->callback);
+             window->callback = NULL;
+          }
+     }
+
    if (window->surface)
      {
         wl_surface_attach(window->surface, NULL, 0, 0);
@@ -1188,6 +1201,7 @@ ecore_wl2_window_hide(Ecore_Wl2_Window *window)
         window->commit_pending = EINA_FALSE;
      }
 
+   /* The commit added a callback, disconnect it */
    if (window->callback)
      {
         wl_callback_destroy(window->callback);