display: Consider monitors in landscape mode for minimum size
Some devices have panels with a native resolution in portrait mode. In these cases the monitor will likely be used in landscape mode. Accept the modes as if they are landscape rather than portrait. A further improvement would be to restrict the orientation setting. Fixes #639
This commit is contained in:
parent
fe932a4cea
commit
4e800cc558
2 changed files with 11 additions and 3 deletions
|
@ -1211,13 +1211,18 @@ is_scaled_mode_allowed (CcDisplayConfigDBus *self,
|
||||||
CcDisplayMode *pmode,
|
CcDisplayMode *pmode,
|
||||||
double scale)
|
double scale)
|
||||||
{
|
{
|
||||||
|
gint width, height;
|
||||||
CcDisplayModeDBus *mode = CC_DISPLAY_MODE_DBUS (pmode);
|
CcDisplayModeDBus *mode = CC_DISPLAY_MODE_DBUS (pmode);
|
||||||
|
|
||||||
if (!cc_display_mode_dbus_is_supported_scale (pmode, scale))
|
if (!cc_display_mode_dbus_is_supported_scale (pmode, scale))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return (round (mode->width / scale) >= self->min_width &&
|
/* Do the math as if the monitor is always in landscape mode. */
|
||||||
round (mode->height / scale) >= self->min_height);
|
width = round (mode->width / scale);
|
||||||
|
height = round (mode->height / scale);
|
||||||
|
|
||||||
|
return (MAX (width, height) >= self->min_width &&
|
||||||
|
MIN (width, height) >= self->min_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
|
@ -40,7 +40,10 @@
|
||||||
#include "cc-display-resources.h"
|
#include "cc-display-resources.h"
|
||||||
#include "cc-display-settings.h"
|
#include "cc-display-settings.h"
|
||||||
|
|
||||||
/* The minimum supported size for the panel */
|
/* The minimum supported size for the panel
|
||||||
|
* Note that WIDTH is assumed to be the larger size and we accept portrait
|
||||||
|
* mode too effectively (in principle we should probably restrict the rotation
|
||||||
|
* setting in that case). */
|
||||||
#define MINIMUM_WIDTH 740
|
#define MINIMUM_WIDTH 740
|
||||||
#define MINIMUM_HEIGHT 530
|
#define MINIMUM_HEIGHT 530
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue