Commit bbd1919e authored by Guido Gunther's avatar Guido Gunther

PhoshShell: When determining the current screen layout look at the current mode

So far we looked at the mode with the highest resolution.

Another fix for #30. Where add a custom mode to the end of the mode
list.
parent 3eb2d0ca
......@@ -600,7 +600,8 @@ phosh_shell_get_monitor_manager (PhoshShell *self)
void
phosh_shell_get_usable_area (PhoshShell *self, gint *x, gint *y, gint *width, gint *height)
{
PhoshMonitor *monitor = NULL;
PhoshMonitor *monitor;
PhoshMonitorMode *mode;
PhoshShellPrivate *priv;
gint w, h;
gint scale;
......@@ -610,14 +611,15 @@ phosh_shell_get_usable_area (PhoshShell *self, gint *x, gint *y, gint *width, gi
monitor = phosh_shell_get_primary_monitor (self);
g_return_if_fail(monitor);
mode = phosh_monitor_get_current_mode (monitor);
scale = monitor->scale ? monitor->scale : 1;
if (priv->rotation) {
w = monitor->height / scale;
h = monitor->width / scale - PHOSH_PANEL_HEIGHT - PHOSH_HOME_HEIGHT;
w = mode->height / scale;
h = mode->width / scale - PHOSH_PANEL_HEIGHT - PHOSH_HOME_HEIGHT;
} else {
w = monitor->width / scale;
h = monitor->height / scale - PHOSH_PANEL_HEIGHT - PHOSH_HOME_HEIGHT;
w = mode->width / scale;
h = mode->height / scale - PHOSH_PANEL_HEIGHT - PHOSH_HOME_HEIGHT;
}
if (x)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment