static Eina_Bool _init(void);
static void _shutdown(void);
-static void _screen_info_refresh(void);
+static Eina_Bool _screen_info_refresh(void);
static Eina_Bool _e_event_config_loaded_cb(void *data, int type, void *e);
static void _try_restore_configuration(void);
static void _event_listeners_add(void);
return 1;
}
-EAPI void
+EAPI Eina_Bool
e_randr_screen_info_refresh(void)
{
- _screen_info_refresh();
+ return _screen_info_refresh();
}
static Eina_Bool
_init(void)
{
- e_randr_screen_info_refresh();
+ if (!e_randr_screen_info_refresh())
+ return EINA_FALSE;
_event_listeners_add();
_try_restore_configuration();
/**
* @return EINA_TRUE if info could be refreshed, else EINA_FALSE
*/
-static void
+static Eina_Bool
_screen_info_refresh(void)
{
Ecore_X_Window *roots;
// Value set/retrieval helper functions
if (e_randr_screen_info.randr_version == ECORE_X_RANDR_1_1)
{
- _11_screen_info_refresh();
+ return _11_screen_info_refresh();
}
else if (e_randr_screen_info.randr_version >= ECORE_X_RANDR_1_2)
{
- _12_screen_info_refresh();
+ return _12_screen_info_refresh();
}
+
+ return EINA_FALSE;
}
static Eina_Bool
};
EINTERN Eina_Bool e_randr_init(void);
-EAPI void e_randr_screen_info_refresh(void);
+EAPI Eina_Bool e_randr_screen_info_refresh(void);
EINTERN int e_randr_shutdown(void);
EINTERN void e_randr_serialized_setup_free(E_Randr_Serialized_Setup *ss);
EINTERN void e_randr_11_serialized_setup_free(E_Randr_Serialized_Setup_11 *ss_11);
*
*****************************************************************
*/
-void
+Eina_Bool
_11_screen_info_refresh(void)
{
EINA_SAFETY_ON_TRUE_RETURN(E_RANDR_11_NO);
_11_screen_info_free(e_randr_screen_info.rrvd_info.randr_info_11);
- e_randr_screen_info.rrvd_info.randr_info_11 = _11_screen_info_new();
+ return ((e_randr_screen_info.rrvd_info.randr_info_11 = _11_screen_info_new()));
}
*
*****************************************************************
*/
- void
+ Eina_Bool
_12_screen_info_refresh(void)
{
EINA_SAFETY_ON_TRUE_RETURN(e_randr_screen_info.randr_version < ECORE_X_RANDR_1_2);
if (e_randr_screen_info.rrvd_info.randr_info_12)
_12_screen_info_free(e_randr_screen_info.rrvd_info.randr_info_12);
- e_randr_screen_info.rrvd_info.randr_info_12 = _screen_info_12_new();
- _structs_init();
+ if (!(e_randr_screen_info.rrvd_info.randr_info_12 = _screen_info_12_new()) ||
+ !_structs_init())
+ return EINA_FALSE;
+
_screen_primary_output_assign(NULL);
}
{
output_info = _12_screen_info_output_info_get(outputs[noutputs]);
if (!output_info)
- fprintf(stderr, "E_RANDR: Could not find output struct for output %d.\n", outputs[noutputs]);
+ {
+ fprintf(stderr, "E_RANDR: Could not find output struct for output %d.\n", outputs[noutputs]);
+ continue;
+ }
crtc_info->outputs = eina_list_append(crtc_info->outputs, output_info);
}
free(outputs);
{
EINA_LIST_FOREACH(outputs, output_iter, output_info)
{
- if (!output_info->monitor)
+ if (!output_info || !output_info->monitor)
continue;
if (!eina_list_data_find(output_info->monitor->modes, mode_info))
common_modes = eina_list_remove(common_modes, mode_info);
// RandRR == 1.1
E_Randr_Screen_Info_11 *_11_screen_info_new(void);
void _11_screen_info_free(E_Randr_Screen_Info_11 *screen_info_11);
-void _11_screen_info_refresh(void);
+Eina_Bool _11_screen_info_refresh(void);
Eina_Bool _11_try_restore_configuration(void);
void _11_store_configuration(E_Randr_Configuration_Store_Modifier modifier);
// RandRR >= 1.2
E_Randr_Screen_Info_12 *_12_screen_info_new(void);
void _12_screen_info_free(E_Randr_Screen_Info_12 *screen_info_12);
-void _12_screen_info_refresh(void);
+Eina_Bool _12_screen_info_refresh(void);
void _12_policies_restore(void);
void _12_event_listeners_add(void);
void _12_event_listeners_remove(void);