display: Sort resolutions by width first
We used to sort by area, but really, that is more confusing than helpful. Instead, sort by width then height. Fixes: #1237
This commit is contained in:
parent
44b7e37fb4
commit
feb762dde9
1 changed files with 6 additions and 5 deletions
|
@ -208,11 +208,12 @@ sort_modes_by_area_desc (CcDisplayMode *a, CcDisplayMode *b)
|
||||||
cc_display_mode_get_resolution (a, &wa, &ha);
|
cc_display_mode_get_resolution (a, &wa, &ha);
|
||||||
cc_display_mode_get_resolution (b, &wb, &hb);
|
cc_display_mode_get_resolution (b, &wb, &hb);
|
||||||
|
|
||||||
/* Prefer wide screen if the size is equal */
|
/* Sort first by width, then height.
|
||||||
res = wb*hb - wa*ha;
|
* We used to sort by area, but that can be confusing. */
|
||||||
if (res == 0)
|
res = wb - wa;
|
||||||
return wb - wa;
|
if (res)
|
||||||
return res;
|
return res;
|
||||||
|
return hb - ha;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue