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.
This commit is contained in:
Derek Foreman 2017-11-29 15:17:36 -06:00
parent 15fdbca653
commit f3dd394b85
3 changed files with 8 additions and 0 deletions

View File

@ -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);

View File

@ -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

View File

@ -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;
}