monitor: Check mode resolution area when determining advertisability

Explicitly checking the dimensions of a mode to determine whether it
should be advertised or not fails for portrait style modes. Avoid this
by checking the area instead.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/722
This commit is contained in:
Jonas Ådahl 2019-08-12 10:52:48 +02:00
parent 18838bcefc
commit 989a281b5f

View File

@ -34,8 +34,7 @@
#define SCALE_FACTORS_STEPS (1.0 / (float) SCALE_FACTORS_PER_INTEGER) #define SCALE_FACTORS_STEPS (1.0 / (float) SCALE_FACTORS_PER_INTEGER)
#define MINIMUM_SCALE_FACTOR 1.0f #define MINIMUM_SCALE_FACTOR 1.0f
#define MAXIMUM_SCALE_FACTOR 4.0f #define MAXIMUM_SCALE_FACTOR 4.0f
#define MINIMUM_LOGICAL_WIDTH 800 #define MINIMUM_LOGICAL_AREA (800 * 480)
#define MINIMUM_LOGICAL_HEIGHT 480
#define MAXIMUM_REFRESH_RATE_DIFF 0.001 #define MAXIMUM_REFRESH_RATE_DIFF 0.001
typedef struct _MetaMonitorMode typedef struct _MetaMonitorMode
@ -1661,8 +1660,7 @@ static gboolean
is_logical_size_large_enough (int width, is_logical_size_large_enough (int width,
int height) int height)
{ {
return width >= MINIMUM_LOGICAL_WIDTH && return width * height >= MINIMUM_LOGICAL_AREA;
height >= MINIMUM_LOGICAL_HEIGHT;
} }
gboolean gboolean