Commit b403b6ff authored by Guido Gunther's avatar Guido Gunther

phosh_shell_get_usable_area: Allow for NULL arguments

If one only needs certain values others can be passed as NULL
parent 3c9d5c63
......@@ -538,6 +538,7 @@ phosh_shell_get_usable_area (PhoshShell *self, gint *x, gint *y, gint *width, gi
GdkMonitor *monitor = gdk_display_get_monitor (display, 0);
GdkRectangle geom;
gint panel_height = 0;
gint w, h;
g_return_if_fail(monitor);
gdk_monitor_get_geometry (monitor, &geom);
......@@ -548,15 +549,21 @@ phosh_shell_get_usable_area (PhoshShell *self, gint *x, gint *y, gint *width, gi
/* GDK fails to take rotation into account
* https://bugzilla.gnome.org/show_bug.cgi?id=793618 */
if (priv->rotation != 90 && priv->rotation != 270) {
*width = geom.width;
*height = geom.height - panel_height;
w = geom.width;
h = geom.height - panel_height;
} else {
*width = geom.height;
*height = geom.width - panel_height;
w = geom.height;
h = geom.width - panel_height;
}
*x = 0;
*y = panel_height;
if (x)
*x = 0;
if (y)
*y = panel_height;
if (width)
*width = w;
if (height)
*height = h;
}
......
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