[gimp] Fix compilation on Mac 10.6 and 10.7 (#2112)
- From: Alex Samorukov <asamorukov src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Fix compilation on Mac 10.6 and 10.7 (#2112)
- Date: Wed, 24 Oct 2018 08:46:43 +0000 (UTC)
commit bd48996933970a39f767a364f70316246aa639bc
Author: Oleksii Samorukov <samm os2 kiev ua>
Date: Wed Oct 24 10:45:07 2018 +0200
Fix compilation on Mac 10.6 and 10.7 (#2112)
app/display/gimpimagewindow.c | 9 ++++-----
app/widgets/gimpwidgets-utils.c | 2 +-
libgimpwidgets/gimppickbutton-quartz.c | 15 +++++++++++++++
3 files changed, 20 insertions(+), 6 deletions(-)
---
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index 4fa5622a5c..bf991cfc8d 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -94,6 +94,10 @@
/* Whether the window's maximized or not */
#define GIMP_IMAGE_WINDOW_MAXIMIZED "maximized"
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
+#define NSWindowCollectionBehaviorFullScreenAuxiliary (1 << 8)
+#endif
+
enum
{
@@ -604,12 +608,7 @@ gimp_image_window_map (GtkWidget *widget)
* as soon as GTK+ has proper support for this, we will migrate to the
* new-style full screen mode.
*/
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
ns_window.collectionBehavior |= NSWindowCollectionBehaviorFullScreenAuxiliary;
-#else
- /* Hard code the define ... */
- ns_window.collectionBehavior |= 1 << 8;
-#endif
#endif /* !GDK_WINDOWING_QUARTZ */
}
diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c
index 2114b332df..d435aac872 100644
--- a/app/widgets/gimpwidgets-utils.c
+++ b/app/widgets/gimpwidgets-utils.c
@@ -34,7 +34,7 @@
#endif
#ifdef PLATFORM_OSX
-#include <CoreGraphics/CoreGraphics.h>
+#include <ApplicationServices/ApplicationServices.h>
#endif
#include "libgimpbase/gimpbase.h"
diff --git a/libgimpwidgets/gimppickbutton-quartz.c b/libgimpwidgets/gimppickbutton-quartz.c
index e18b864a09..f6902fe3ac 100644
--- a/libgimpwidgets/gimppickbutton-quartz.c
+++ b/libgimpwidgets/gimppickbutton-quartz.c
@@ -33,6 +33,21 @@
#include <ApplicationServices/ApplicationServices.h>
#endif
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
+@interface NSWindow (GIMPExt)
+- (NSRect) convertRectToScreen: (NSRect)aRect;
+@end
+@implementation NSWindow (GIMPExt)
+- (NSRect) convertRectToScreen: (NSRect)aRect
+{
+ NSRect result = aRect;
+ NSPoint origin = result.origin;
+ result.origin = [self convertBaseToScreen:origin];
+ return result;
+}
+@end
+#endif
+
@interface GimpPickWindowController : NSObject
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]