forked from enlightenment/enlightenment
wayland: Handle failure to init a display screen
Summary: e_comp_wl_output_init will fail (silently) under a couple of conditions. Instead, make it propagate the error so it can be handled at a higher level. For now just issue an error message. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewers: cedric, devilhorns, zmike Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2155
This commit is contained in:
parent
f225f04002
commit
673de24fa7
|
@ -763,12 +763,13 @@ _e_comp_wl_cb_randr_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *e
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
e_comp_wl_output_init(screen->id, screen->info.screen,
|
if (!e_comp_wl_output_init(screen->id, screen->info.screen,
|
||||||
screen->info.name,
|
screen->info.name,
|
||||||
screen->config.geom.x, screen->config.geom.y,
|
screen->config.geom.x, screen->config.geom.y,
|
||||||
screen->config.geom.w, screen->config.geom.h,
|
screen->config.geom.w, screen->config.geom.h,
|
||||||
screen->info.size.w, screen->info.size.h,
|
screen->info.size.w, screen->info.size.h,
|
||||||
screen->config.mode.refresh, 0, transform);
|
screen->config.mode.refresh, 0, transform))
|
||||||
|
ERR("Could not initialize screen %s");
|
||||||
}
|
}
|
||||||
|
|
||||||
return ECORE_CALLBACK_RENEW;
|
return ECORE_CALLBACK_RENEW;
|
||||||
|
@ -2851,22 +2852,27 @@ _e_comp_wl_output_get(Eina_List *outputs, const char *id)
|
||||||
* @param refresh output's refresh rate in Hz
|
* @param refresh output's refresh rate in Hz
|
||||||
* @param subpixel output's subpixel layout
|
* @param subpixel output's subpixel layout
|
||||||
* @param transform output's rotation and/or mirror transformation
|
* @param transform output's rotation and/or mirror transformation
|
||||||
|
*
|
||||||
|
* @returns True if a display output object could be added or updated
|
||||||
*/
|
*/
|
||||||
EAPI void
|
EAPI Eina_Bool
|
||||||
e_comp_wl_output_init(const char *id, const char *make, const char *model, int x, int y, int w, int h, int pw, int ph, unsigned int refresh, unsigned int subpixel, unsigned int transform)
|
e_comp_wl_output_init(const char *id, const char *make, const char *model,
|
||||||
|
int x, int y, int w, int h, int pw, int ph,
|
||||||
|
unsigned int refresh, unsigned int subpixel,
|
||||||
|
unsigned int transform)
|
||||||
{
|
{
|
||||||
E_Comp_Data *cdata;
|
E_Comp_Data *cdata;
|
||||||
E_Comp_Wl_Output *output;
|
E_Comp_Wl_Output *output;
|
||||||
Eina_List *l2;
|
Eina_List *l2;
|
||||||
struct wl_resource *resource;
|
struct wl_resource *resource;
|
||||||
|
|
||||||
if (!(cdata = e_comp->wl_comp_data)) return;
|
if (!(cdata = e_comp->wl_comp_data)) return EINA_FALSE;
|
||||||
|
|
||||||
/* retrieve named output; or create it if it doesn't exist */
|
/* retrieve named output; or create it if it doesn't exist */
|
||||||
output = _e_comp_wl_output_get(cdata->outputs, id);
|
output = _e_comp_wl_output_get(cdata->outputs, id);
|
||||||
if (!output)
|
if (!output)
|
||||||
{
|
{
|
||||||
if (!(output = E_NEW(E_Comp_Wl_Output, 1))) return;
|
if (!(output = E_NEW(E_Comp_Wl_Output, 1))) return EINA_FALSE;
|
||||||
|
|
||||||
if (id) output->id = eina_stringshare_add(id);
|
if (id) output->id = eina_stringshare_add(id);
|
||||||
if (make) output->make = eina_stringshare_add(make);
|
if (make) output->make = eina_stringshare_add(make);
|
||||||
|
@ -2914,4 +2920,5 @@ e_comp_wl_output_init(const char *id, const char *make, const char *model, int x
|
||||||
if (wl_resource_get_version(resource) >= WL_OUTPUT_DONE_SINCE_VERSION)
|
if (wl_resource_get_version(resource) >= WL_OUTPUT_DONE_SINCE_VERSION)
|
||||||
wl_output_send_done(resource);
|
wl_output_send_done(resource);
|
||||||
}
|
}
|
||||||
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -291,7 +291,7 @@ EAPI E_Comp_Wl_Buffer *e_comp_wl_buffer_get(struct wl_resource *resource);
|
||||||
|
|
||||||
EAPI struct wl_signal e_comp_wl_surface_create_signal_get(E_Comp *comp);
|
EAPI struct wl_signal e_comp_wl_surface_create_signal_get(E_Comp *comp);
|
||||||
EAPI double e_comp_wl_idle_time_get(void);
|
EAPI double e_comp_wl_idle_time_get(void);
|
||||||
EAPI void e_comp_wl_output_init(const char *id, const char *make, const char *model, int x, int y, int w, int h, int pw, int ph, unsigned int refresh, unsigned int subpixel, unsigned int transform);
|
EAPI Eina_Bool e_comp_wl_output_init(const char *id, const char *make, const char *model, int x, int y, int w, int h, int pw, int ph, unsigned int refresh, unsigned int subpixel, unsigned int transform);
|
||||||
|
|
||||||
static inline uint64_t
|
static inline uint64_t
|
||||||
e_comp_wl_id_get(uint32_t id, pid_t pid)
|
e_comp_wl_id_get(uint32_t id, pid_t pid)
|
||||||
|
|
Loading…
Reference in New Issue