derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=f3dd394b85bd47c36f7ab76bb9a3900e826c4b74

commit f3dd394b85bd47c36f7ab76bb9a3900e826c4b74
Author: Derek Foreman <der...@osg.samsung.com>
Date:   Wed Nov 29 15:17:36 2017 -0600

    ecore_wl2: Return NULL from ecore_wl2_window_display_get during recovery
    
    This should save us from having to set the window to in the engine info
    NULL and then back during/after recovery.
---
 src/lib/ecore_wl2/ecore_wl2_display.c | 3 +++
 src/lib/ecore_wl2/ecore_wl2_private.h | 1 +
 src/lib/ecore_wl2/ecore_wl2_window.c  | 4 ++++
 3 files changed, 8 insertions(+)

diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c 
b/src/lib/ecore_wl2/ecore_wl2_display.c
index c703a1ace2..9785406d97 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -468,6 +468,7 @@ _recovery_timer_add(Ecore_Wl2_Display *ewd)
 
    ewd->shell_done = EINA_FALSE;
    ewd->sync_done = EINA_FALSE;
+   ewd->recovering = EINA_TRUE;
 
    _ecore_wl2_display_globals_cleanup(ewd);
 
@@ -682,6 +683,8 @@ _ecore_wl2_display_connect(Ecore_Wl2_Display *ewd, 
Eina_Bool sync)
    ewd->wl.display = wl_display_connect(ewd->name);
    if (!ewd->wl.display) return EINA_FALSE;
 
+   ewd->recovering = EINA_FALSE;
+
    ewd->wl.registry = wl_display_get_registry(ewd->wl.display);
    wl_registry_add_listener(ewd->wl.registry, &_registry_listener, ewd);
 
diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h 
b/src/lib/ecore_wl2/ecore_wl2_private.h
index 783c82e1da..b1df67f302 100644
--- a/src/lib/ecore_wl2/ecore_wl2_private.h
+++ b/src/lib/ecore_wl2/ecore_wl2_private.h
@@ -115,6 +115,7 @@ struct _Ecore_Wl2_Display
 
    Eina_Bool sync_done : 1;
    Eina_Bool shell_done : 1;
+   Eina_Bool recovering : 1;
 };
 
 struct _Ecore_Wl2_Subsurface
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c 
b/src/lib/ecore_wl2/ecore_wl2_window.c
index 824988f050..b23fb252b6 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -1033,6 +1033,10 @@ EAPI Ecore_Wl2_Display *
 ecore_wl2_window_display_get(const Ecore_Wl2_Window *window)
 {
    EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(window->display, NULL);
+
+   if (window->display->recovering) return EINA_FALSE;
+
    return window->display;
 }
 

-- 


Reply via email to