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) ...@@ -600,7 +600,8 @@ phosh_shell_get_monitor_manager (PhoshShell *self)
void void
phosh_shell_get_usable_area (PhoshShell *self, gint *x, gint *y, gint *width, gint *height) phosh_shell_get_usable_area (PhoshShell *self, gint *x, gint *y, gint *width, gint *height)
{ {
PhoshMonitor *monitor = NULL; PhoshMonitor *monitor;
PhoshMonitorMode *mode;
PhoshShellPrivate *priv; PhoshShellPrivate *priv;
gint w, h; gint w, h;
gint scale; gint scale;
...@@ -610,14 +611,15 @@ phosh_shell_get_usable_area (PhoshShell *self, gint *x, gint *y, gint *width, gi ...@@ -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); monitor = phosh_shell_get_primary_monitor (self);
g_return_if_fail(monitor); g_return_if_fail(monitor);
mode = phosh_monitor_get_current_mode (monitor);
scale = monitor->scale ? monitor->scale : 1; scale = monitor->scale ? monitor->scale : 1;
if (priv->rotation) { if (priv->rotation) {
w = monitor->height / scale; w = mode->height / scale;
h = monitor->width / scale - PHOSH_PANEL_HEIGHT - PHOSH_HOME_HEIGHT; h = mode->width / scale - PHOSH_PANEL_HEIGHT - PHOSH_HOME_HEIGHT;
} else { } else {
w = monitor->width / scale; w = mode->width / scale;
h = monitor->height / scale - PHOSH_PANEL_HEIGHT - PHOSH_HOME_HEIGHT; h = mode->height / scale - PHOSH_PANEL_HEIGHT - PHOSH_HOME_HEIGHT;
} }
if (x) 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