Skip to content
Snippets Groups Projects

phosh: Scale monitor resolution

Merged Guido Gunther requested to merge guido.gunther/phosh:fix-menus-with-scale into master
+ 11
2
@@ -601,15 +601,24 @@ void
phosh_shell_get_usable_area (PhoshShell *self, gint *x, gint *y, gint *width, gint *height)
{
PhoshMonitor *monitor = NULL;
PhoshShellPrivate *priv;
gint w, h;
gint scale;
g_return_if_fail (PHOSH_IS_SHELL (self));
priv = phosh_shell_get_instance_private (self);
monitor = phosh_shell_get_primary_monitor (self);
g_return_if_fail(monitor);
scale = monitor->scale ? monitor->scale : 1;
w = monitor->width / scale;
h = monitor->height / scale - PHOSH_PANEL_HEIGHT - PHOSH_HOME_HEIGHT;
if (priv->rotation) {
w = monitor->height / scale;
h = monitor->width / scale - PHOSH_PANEL_HEIGHT - PHOSH_HOME_HEIGHT;
} else {
w = monitor->width / scale;
h = monitor->height / scale - PHOSH_PANEL_HEIGHT - PHOSH_HOME_HEIGHT;
}
if (x)
*x = 0;
Loading