forked from enlightenment/enlightenment
conf_randr: List modes using double scan correctly.
As we can detect for double scan (since randr 1.2), list the mode as valid, and also ensure the refresh rate is displayed correctly. Each line is rendered twice, doubles the dot clock, so divide the settings view by 2 so that it makes "sense". Can always add flags to settings if deemed necessary.
This commit is contained in:
parent
5737eeb993
commit
2027734141
|
@ -791,6 +791,7 @@ e_comp_x_randr_create(void)
|
||||||
m->refresh =
|
m->refresh =
|
||||||
(double)minfo->dotClock /
|
(double)minfo->dotClock /
|
||||||
(double)(minfo->hTotal * minfo->vTotal);
|
(double)(minfo->hTotal * minfo->vTotal);
|
||||||
|
m->flags = minfo->modeFlags;
|
||||||
if (j == (modes_pref - 1))
|
if (j == (modes_pref - 1))
|
||||||
m->preferred = EINA_TRUE;
|
m->preferred = EINA_TRUE;
|
||||||
s->info.modes = eina_list_append(s->info.modes, m);
|
s->info.modes = eina_list_append(s->info.modes, m);
|
||||||
|
|
|
@ -50,6 +50,7 @@ struct _E_Randr2_Mode
|
||||||
{
|
{
|
||||||
int w, h; // resolution width and height
|
int w, h; // resolution width and height
|
||||||
double refresh; // refresh in hz
|
double refresh; // refresh in hz
|
||||||
|
unsigned int flags; // randr mode flags.
|
||||||
Eina_Bool preferred E_BITFIELD; // is this the preferred mode for the device?
|
Eina_Bool preferred E_BITFIELD; // is this the preferred mode for the device?
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -387,7 +387,10 @@ _basic_screen_info_fill(E_Config_Dialog_Data *cfdata, E_Config_Randr2_Screen *cs
|
||||||
{
|
{
|
||||||
mode_cbdata->cfdata = cfdata;
|
mode_cbdata->cfdata = cfdata;
|
||||||
mode_cbdata->mode = *m;
|
mode_cbdata->mode = *m;
|
||||||
snprintf(buf, sizeof(buf), "%ix%i @ %1.2fHz", m->w, m->h, m->refresh);
|
if (m->flags & ECORE_X_RANDR_MODE_DOUBLE_SCAN)
|
||||||
|
snprintf(buf, sizeof(buf), "%ix%i @ %1.2fHz", m->w, m->h, m->refresh / 2);
|
||||||
|
else
|
||||||
|
snprintf(buf, sizeof(buf), "%ix%i @ %1.2fHz", m->w, m->h, m->refresh);
|
||||||
it = elm_list_item_append(cfdata->modes_obj, buf, NULL, NULL, _cb_mode_set, mode_cbdata);
|
it = elm_list_item_append(cfdata->modes_obj, buf, NULL, NULL, _cb_mode_set, mode_cbdata);
|
||||||
cfdata->freelist = eina_list_append(cfdata->freelist, mode_cbdata);
|
cfdata->freelist = eina_list_append(cfdata->freelist, mode_cbdata);
|
||||||
/* printf("mode add %p %p %p\n", mode_cbdata, cfdata->modes_obj, it); */
|
/* printf("mode add %p %p %p\n", mode_cbdata, cfdata->modes_obj, it); */
|
||||||
|
|
Loading…
Reference in New Issue