From e14f9fc500c044b6112fe91eb5efa00b5c8914ab Mon Sep 17 00:00:00 2001 From: Lukas Oberhuber Date: Sun, 3 Oct 2021 11:20:15 +0000 Subject: [PATCH] =?UTF-8?q?app:=20allow=20compiling=20on=20Mac=20OS=20wher?= =?UTF-8?q?e=20gimpimagewindow.c=20needs=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … an API that went private in GTK 3. Note from reviewer (Jehan): this API became public again in commit gtk@242b76a7, available since GTK 3.24.29. Before this, the function (gdk_quartz_window_get_nswindow()) was actually still in the ABI, so we could declare the function locally before using it. This is an ugly workaround, but it works. What we do is providing both solutions depending on GTK version, leaving build warnings as constant reminders so that we remember to get rid of the workaround when we bump minimum GTK requirement. Cf. discussions in gtk#2452 and gimp!483. --- app/display/gimpimagewindow.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c index c475b29952..0b5dfb98a7 100644 --- a/app/display/gimpimagewindow.c +++ b/app/display/gimpimagewindow.c @@ -31,7 +31,16 @@ #ifdef GDK_WINDOWING_QUARTZ #import #include -#endif /* !GDK_WINDOWING_QUARTZ */ + +#if GTK_CHECK_VERSION(3, 24, 29) +#warning Using a workaround for older GTK versions. +#warning If minimum requirement was bumped to 3.24.29 or over, remove it. +#warning See MR !483 +#include "gdk/quartz/gdkquartz-cocoa-access.h" +#else +NSWindow *gdk_quartz_window_get_nswindow (GdkWindow *window); +#endif /* GTK_CHECK_VERSION(3, 24, 29) */ +#endif /* GDK_WINDOWING_QUARTZ */ #include "libgimpbase/gimpbase.h" #include "libgimpmath/gimpmath.h"