[gnome-control-center/benzea/resolution-sort] display: Sort resolutions by width first
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/benzea/resolution-sort] display: Sort resolutions by width first
- Date: Thu, 21 Jan 2021 16:51:38 +0000 (UTC)
commit feb762dde9f5cceffd9e8da6b30fa1ed2e58b428
Author: Benjamin Berg <bberg redhat com>
Date: Thu Jan 21 17:31:28 2021 +0100
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
panels/display/cc-display-settings.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/panels/display/cc-display-settings.c b/panels/display/cc-display-settings.c
index 49ddcf0f7..383936eca 100644
--- a/panels/display/cc-display-settings.c
+++ b/panels/display/cc-display-settings.c
@@ -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;
- return res;
+ /* 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]