Skip to content
Snippets Groups Projects
Commit b2c6d68c authored by Guido Gunther's avatar Guido Gunther :zzz:
Browse files

phosh: Scale monitor resolution

wl_output gives us the unscaled resolution. We need to scale that with
the currently set scale. This brings the settings menu back to the
screen and makes the favorites menu fit.

Also take the home buttons size into account and flip width and height
on rotation.

Closes: #30
parent 68910f13
No related branches found
No related tags found
No related merge requests found
......@@ -601,19 +601,29 @@ void
phosh_shell_get_usable_area (PhoshShell *self, gint *x, gint *y, gint *width, gint *height)
{
PhoshMonitor *monitor = NULL;
gint panel_height = 0;
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);
w = monitor->width;
h = monitor->height - panel_height;
scale = monitor->scale ? monitor->scale : 1;
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;
if (y)
*y = panel_height;
*y = PHOSH_PANEL_HEIGHT;
if (width)
*width = w;
if (height)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment