gdkwindow-quartz: partial aspect ratio support

Support was added for GDK_HINT_ASPECT in
gdk_quartz_window_set_geometry_hints though with one restriction:
min_aspect and max_aspect have to be equal, which I believe corresponds
to the most common usage. A warning will be printed if this condition is
not met but min_aspect will be used anyway.
This commit is contained in:
Tom Schoonjans 2015-07-06 17:34:37 +02:00 committed by John Ralls
parent d2f27bfe71
commit 7d43cda493

View File

@ -1863,7 +1863,17 @@ gdk_quartz_window_set_geometry_hints (GdkWindow *window,
if (geom_mask & GDK_HINT_ASPECT)
{
/* FIXME: Implement */
NSSize size;
if (geometry->min_aspect != geometry->max_aspect)
{
g_warning ("Only equal minimum and maximum aspect ratios are supported on Mac OS. Using minimum aspect ratio...");
}
size.width = geometry->min_aspect;
size.height = 1.0;
[impl->toplevel setContentAspectRatio:size];
}
if (geom_mask & GDK_HINT_WIN_GRAVITY)