[gimp] app: allow compiling on Mac OS where gimpimagewindow.c needs…



commit e14f9fc500c044b6112fe91eb5efa00b5c8914ab
Author: Lukas Oberhuber <lukaso gmail com>
Date:   Sun Oct 3 11:20:15 2021 +0000

    app: allow compiling on Mac OS where gimpimagewindow.c needs…
    
    … 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 <AppKit/AppKit.h>
 #include <gdk/gdkquartz.h>
-#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"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]