Set primary output before crtc settings.
If the primary output saved in config does not exist, then set primary to the first output. Signed-off-by: Chris Michael <devilhorns@comcast.net>
This commit is contained in:
parent
028c6ba378
commit
04936b207a
|
@ -524,9 +524,32 @@ _e_randr_config_restore(void)
|
||||||
|
|
||||||
if (ocount > 0)
|
if (ocount > 0)
|
||||||
{
|
{
|
||||||
Ecore_X_Randr_Output *couts;
|
Ecore_X_Randr_Output *couts, primary = 0;
|
||||||
Eina_List *o;
|
Eina_List *o;
|
||||||
E_Randr_Output_Config *out;
|
E_Randr_Output_Config *out;
|
||||||
|
Eina_Bool primary_set = EINA_FALSE;
|
||||||
|
|
||||||
|
/* get the current primary output */
|
||||||
|
primary = ecore_x_randr_primary_output_get(root);
|
||||||
|
EINA_LIST_FOREACH(valid_outputs, o, out)
|
||||||
|
{
|
||||||
|
if ((out->primary) &&
|
||||||
|
((int)out->xid == e_randr_cfg->primary))
|
||||||
|
{
|
||||||
|
ecore_x_randr_primary_output_set(root, out->xid);
|
||||||
|
primary_set = EINA_TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!primary_set)
|
||||||
|
{
|
||||||
|
/* if no primary was set, set it to the first output */
|
||||||
|
out = eina_list_nth(valid_outputs, 0);
|
||||||
|
ecore_x_randr_primary_output_set(root, out->xid);
|
||||||
|
e_randr_cfg->primary = (int)out->xid;
|
||||||
|
e_randr_config_save();
|
||||||
|
}
|
||||||
|
|
||||||
couts = malloc(ocount * sizeof(Ecore_X_Randr_Output));
|
couts = malloc(ocount * sizeof(Ecore_X_Randr_Output));
|
||||||
EINA_LIST_FOREACH(valid_outputs, o, out)
|
EINA_LIST_FOREACH(valid_outputs, o, out)
|
||||||
|
@ -550,14 +573,6 @@ _e_randr_config_restore(void)
|
||||||
crtc_cfg->mode,
|
crtc_cfg->mode,
|
||||||
crtc_cfg->orient);
|
crtc_cfg->orient);
|
||||||
|
|
||||||
EINA_LIST_FOREACH(valid_outputs, o, out)
|
|
||||||
if ((out->primary) &&
|
|
||||||
((int)out->xid == e_randr_cfg->primary))
|
|
||||||
{
|
|
||||||
ecore_x_randr_primary_output_set(root, out->xid);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
free(couts);
|
free(couts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -566,8 +581,6 @@ _e_randr_config_restore(void)
|
||||||
eina_list_free(valid_crtcs);
|
eina_list_free(valid_crtcs);
|
||||||
}
|
}
|
||||||
|
|
||||||
// e_randr_config_save();
|
|
||||||
|
|
||||||
// if (need_reset) ecore_x_randr_screen_reset(root);
|
// if (need_reset) ecore_x_randr_screen_reset(root);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue