diff options
author | Tom Schoonjans <Tom.Schoonjans@bam.de> | 2015-07-06 17:34:37 +0200 |
---|---|---|
committer | John Ralls <jralls@ceridwen.us> | 2015-07-07 09:36:29 -0700 |
commit | 7d43cda4934779e7529a905db2762a92eeda2f0b (patch) | |
tree | 44481f71475886ed1f27abe840115beba633548a /gdk/quartz/gdkwindow-quartz.c | |
parent | d2f27bfe7126c4ee726ec4510e9a70521ce87277 (diff) | |
download | gtk+-7d43cda4934779e7529a905db2762a92eeda2f0b.tar.gz |
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.
Diffstat (limited to 'gdk/quartz/gdkwindow-quartz.c')
-rw-r--r-- | gdk/quartz/gdkwindow-quartz.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c index b77be34f31..f05ab9469f 100644 --- a/gdk/quartz/gdkwindow-quartz.c +++ b/gdk/quartz/gdkwindow-quartz.c @@ -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) |