summaryrefslogtreecommitdiff
path: root/src/nsterm.h
diff options
context:
space:
mode:
authorAlan Third <alan@idiocy.org>2020-03-02 17:44:38 +0000
committerAlan Third <alan@idiocy.org>2020-03-02 18:29:09 +0000
commit68109c56e45ff531934bfe81f9bd14a530a35574 (patch)
treed488b135e92a24b19f1557cd19d3c3e38074c3e4 /src/nsterm.h
parent1939f7580bd283286dce8be7c99ab5dec1bb0814 (diff)
downloademacs-68109c56e45ff531934bfe81f9bd14a530a35574.tar.gz
Fix #defines controlling when NS port draws to offscreen buffer
* src/nsterm.h (NS_DRAW_TO_BUFFER): New definition. * src/nsterm.m (ns_update_begin): (ns_update_end): (ns_focus): ([EmacsView updateFrameSize:]): ([EmacsView initFrameFromEmacs:]): ([EmacsView copyRect:to:]): Use new #define.
Diffstat (limited to 'src/nsterm.h')
-rw-r--r--src/nsterm.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/nsterm.h b/src/nsterm.h
index 7c6197f1288..db966e1581b 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -339,6 +339,22 @@ typedef id instancetype;
#endif
+/* macOS 10.14 and above cannot draw directly "to the glass" and
+ therefore we draw to an offscreen buffer and swap it in when the
+ toolkit wants to draw the frame. GNUstep and macOS 10.7 and below
+ do not support this method, so we revert to drawing directly to the
+ glass.
+
+ FIXME: Should we make this macOS 10.8+, or macOS 10.14+? I'm
+ inclined to go with 10.14+ as there have been some reports of funny
+ behaviour on 10.13 and below. It may be worth adding a variable to
+ allow people in the overlapping region to switch between drawing
+ paths. */
+#if defined (NS_IMPL_COCOA) && defined (MAC_OS_X_VERSION_10_14)
+#define NS_DRAW_TO_BUFFER 1
+#endif
+
+
/* ==========================================================================
NSColor, EmacsColor category.
@@ -417,7 +433,7 @@ typedef id instancetype;
int maximized_width, maximized_height;
NSWindow *nonfs_window;
BOOL fs_is_native;
-#ifdef NS_IMPL_COCOA
+#ifdef NS_DRAW_TO_BUFFER
CGContextRef drawingBuffer;
#endif
@public
@@ -460,11 +476,11 @@ typedef id instancetype;
#endif
- (int)fullscreenState;
-#ifdef NS_IMPL_COCOA
+#ifdef NS_DRAW_TO_BUFFER
- (void)focusOnDrawingBuffer;
+- (void)createDrawingBuffer;
#endif
- (void)copyRect:(NSRect)srcRect to:(NSRect)dstRect;
-- (void)createDrawingBuffer;
/* Non-notification versions of NSView methods. Used for direct calls. */
- (void)windowWillEnterFullScreen;