From 2777f6a754a469eb9b71b4d241ca5f3b1ce5a9b1 Mon Sep 17 00:00:00 2001 From: httpdigest Date: Sat, 31 Aug 2019 02:44:04 +0200 Subject: [PATCH] Fix comparison of video modes of equal area This fixes the bug of video modes being discarded if they had a different resolution but the same area as another mode. Fixes #1555. Closes #1556. --- src/monitor.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/monitor.c b/src/monitor.c index 4f86cb80..394026f5 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -56,6 +56,10 @@ static int compareVideoModes(const void* fp, const void* sp) if (farea != sarea) return farea - sarea; + // Then sort on width + if (fm->width != sm->width) + return fm->width - sm->width; + // Lastly sort on refresh rate return fm->refreshRate - sm->refreshRate; }