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 (b, &wb, &hb);
|
||||
|
||||
/* Prefer wide screen if the size is equal */
|
||||
res = wb*hb - wa*ha;
|
||||
if (res == 0)
|
||||
return wb - wa;
|
||||
/* Sort first by width, then height.
|
||||
* We used to sort by area, but that can be confusing. */
|
||||
res = wb - wa;
|
||||
if (res)
|
||||
return res;
|
||||
return hb - ha;
|
||||
}
|
||||
|
||||
static gint
|
||||
|
|
Loading…
Add table
Reference in a new issue