[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Fix GNUstep build
From: |
Alan Third |
Subject: |
[PATCH] Fix GNUstep build |
Date: |
Mon, 22 May 2017 20:21:03 +0100 |
User-agent: |
Mutt/1.7.2 (2016-11-26) |
* src/nsterm.h [NS_IMPL_GNUSTEP]: Add typedefs for Cocoa-only types.
(NSWindowStyleMaskUtilityWindow): #define to NSUtilityWindowMask in
GNUstep and old versions of macOS.
* src/nsfns.m (ns-set-mouse-absolute-pixel-position): Function only
works in cocoa, not GNUstep.
---
src/nsfns.m | 4 ++++
src/nsterm.h | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/src/nsfns.m b/src/nsfns.m
index 00310c051f..3833ee75ac 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -3046,6 +3046,9 @@ value is a list of the form (LEFT, TOP, RIGHT, BOTTOM).
All values are
\(0, 0) of the selected frame's display. */)
(Lisp_Object x, Lisp_Object y)
{
+#ifdef NS_IMPL_COCOA
+ /* GNUstep doesn't support CGWarpMouseCursorPosition, so none of
+ this will work. */
struct frame *f = SELECTED_FRAME ();
EmacsView *view = FRAME_NS_VIEW (f);
NSScreen *screen = [[view window] screen];
@@ -3072,6 +3075,7 @@ value is a list of the form (LEFT, TOP, RIGHT, BOTTOM).
All values are
CGPoint mouse_pos = CGPointMake(mouse_x, mouse_y);
CGWarpMouseCursorPosition (mouse_pos);
+#endif /* NS_IMPL_COCOA */
return Qnil;
}
diff --git a/src/nsterm.h b/src/nsterm.h
index 5da949e1fb..443a40ed6f 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -62,6 +62,13 @@ typedef CGFloat EmacsCGFloat;
typedef float EmacsCGFloat;
#endif
+/* FIXME: It looks as though instancetype will be supported in GNUstep
+ at some point, but I'm not sure what version. */
+#ifdef NS_IMPL_GNUSTEP
+typedef id instancetype;
+typedef int NSWindowStyleMask;
+#endif
+
/* ==========================================================================
Trace support
@@ -1290,6 +1297,7 @@ extern char gnustep_base_version[]; /* version tracking
*/
#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
#define NSWindowStyleMaskResizable NSResizableWindowMask
#define NSWindowStyleMaskTitled NSTitledWindowMask
+#define NSWindowStyleMaskUtilityWindow NSUtilityWindowMask
#define NSAlertStyleCritical NSCriticalAlertStyle
#define NSControlSizeRegular NSRegularControlSize
#endif
--
I think this should do the trick.
--
Alan Third
- [PATCH 06/13] Remove calls to deprecated setUsesScreenFonts, (continued)
- [PATCH 06/13] Remove calls to deprecated setUsesScreenFonts, Philipp Stephani, 2017/05/20
- [PATCH 10/13] Remove unused automatic variables, Philipp Stephani, 2017/05/20
- [PATCH 11/13] Clean up code around 'ns-list-services', Philipp Stephani, 2017/05/20
- [PATCH 12/13] Fix call of registerServicesMenuSendTypes, Philipp Stephani, 2017/05/20
- [PATCH 13/13] Avoid uninitialized read, Philipp Stephani, 2017/05/20
- Re: [PATCH 01/13] Nextstep: Use instancetype explicit return type, Paul Eggert, 2017/05/20
- Re: [PATCH 01/13] Nextstep: Use instancetype explicit return type, Paul Eggert, 2017/05/21
- [PATCH] Fix GNUstep build,
Alan Third <=