[gtk+/gtk-2-24] gdkwindow-quartz: partial aspect ratio support
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24] gdkwindow-quartz: partial aspect ratio support
- Date: Tue, 7 Jul 2015 17:19:54 +0000 (UTC)
commit 93f9c220abed53cf1f10c62787571463c6ff0309
Author: Tom Schoonjans <Tom Schoonjans bam de>
Date: Mon Jul 6 17:34:37 2015 +0200
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.
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 0a011f7..7b43257 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -2185,7 +2185,17 @@ gdk_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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]