diff --git a/src/bin/e_randr.c b/src/bin/e_randr.c index 4187a6cbb..99f9f3c03 100644 --- a/src/bin/e_randr.c +++ b/src/bin/e_randr.c @@ -269,7 +269,7 @@ _e_randr_screen_info_12_new(void) .crtcs = NULL, .outputs = NULL, .primary_output = NULL, - .output_policy = ECORE_X_RANDR_OUTPUT_POLICY_RIGHT, + .output_policy = ECORE_X_RANDR_OUTPUT_POLICY_NONE, .alignment = ECORE_X_RANDR_RELATIVE_ALIGNMENT_NONE }; @@ -786,7 +786,7 @@ _e_randr_event_cb(void *data __UNUSED__, int type, void *ev) if (event->crtc) output_info->crtc = _e_randr_crtc_info_get(event->crtc); - if (!event->crtc && !event->mode) + if (output_info && !output_info->crtc && !event->crtc && !event->mode) { //Monitor was attached! _e_randr_output_info_hw_info_set(output_info); @@ -1175,6 +1175,8 @@ _e_randr_try_enable_output(E_Randr_Output_Info *output_info, Eina_Bool force) //get the CRTC we will refer to, dependend on policy switch (e_randr_screen_info->rrvd_info.randr_info_12->output_policy) { + case ECORE_X_RANDR_OUTPUT_POLICY_NONE: + return EINA_TRUE; case ECORE_X_RANDR_OUTPUT_POLICY_CLONE: /* * Order of approaches to enable a clone (of the primary output): @@ -1268,7 +1270,7 @@ _e_randr_try_enable_output(E_Randr_Output_Info *output_info, Eina_Bool force) break; default: - if ((!usable_crtc->current_mode) || force) + if ((usable_crtc && (!usable_crtc->current_mode)) || force) { //enable and position according to used policies mode_info = ((Ecore_X_Randr_Mode_Info*)eina_list_nth(output_info->preferred_modes, 0)); diff --git a/src/modules/conf_display/e_int_config_display.c b/src/modules/conf_display/e_int_config_display.c index a56db8300..27b62844b 100644 --- a/src/modules/conf_display/e_int_config_display.c +++ b/src/modules/conf_display/e_int_config_display.c @@ -58,7 +58,7 @@ struct _E_Config_Dialog_Data int flip; int flip_x; int flip_y; - int has_rates; + Eina_Bool has_rates; Evas_Object *rate_list; Evas_Object *res_list; @@ -252,11 +252,32 @@ _fill_data(E_Config_Dialog_Data *cfdata) EINA_LIST_FOREACH(e_config->screen_info, iter, restore_info) { - if (restore_info->randr_version == RANDR_11) - { - e_screen_config_11 = restore_info->rrvd_restore_info.restore_info_11; - break; - } + if (restore_info->randr_version == RANDR_11) + { + e_screen_config_11 = restore_info->rrvd_restore_info.restore_info_11; + break; + } + } + + if(!e_screen_config_11) + { + if ((restore_info = E_NEW(E_Randr_Screen_Restore_Info, 1))) + { + restore_info->randr_version = RANDR_11; + if ((e_screen_config_11 = E_NEW(E_Randr_Screen_Restore_Info_11, 1))) + { + restore_info->rrvd_restore_info.restore_info_11 = e_screen_config_11; + if (!(e_config->screen_info = eina_list_append(e_config->screen_info, restore_info))) + { + free(e_screen_config_11); + free(restore_info); + } + } + else + { + free (restore_info); + } + } } rots = ecore_x_randr_screen_primary_output_orientations_get(man->root); @@ -436,7 +457,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf man = e_manager_current_get(); sizes = ecore_x_randr_screen_primary_output_sizes_get(man->root, &s); - cfdata->has_rates = 0; + cfdata->has_rates = EINA_FALSE; if ((!sizes) || (s == 0)) ecore_timer_add(0.5, _deferred_noxrandr_error, NULL); @@ -462,7 +483,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf { Ecore_X_Randr_Refresh_Rate * rt; - cfdata->has_rates = 1; + cfdata->has_rates = EINA_TRUE; rt = E_NEW(Ecore_X_Randr_Refresh_Rate, 1); if (!rt) continue; *rt = rates[j];