summaryrefslogtreecommitdiff
path: root/gdk/quartz/gdkwindow-quartz.c
diff options
context:
space:
mode:
authorTom Schoonjans <Tom.Schoonjans@bam.de>2015-07-06 17:34:37 +0200
committerJohn Ralls <jralls@ceridwen.us>2015-07-07 09:36:29 -0700
commit7d43cda4934779e7529a905db2762a92eeda2f0b (patch)
tree44481f71475886ed1f27abe840115beba633548a /gdk/quartz/gdkwindow-quartz.c
parentd2f27bfe7126c4ee726ec4510e9a70521ce87277 (diff)
downloadgtk+-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.c12
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)