[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/ns/surface-stuff 090ac35: Make the NS buffer copy happen before
From: |
Alan Third |
Subject: |
scratch/ns/surface-stuff 090ac35: Make the NS buffer copy happen before we need it |
Date: |
Sun, 23 May 2021 07:37:52 -0400 (EDT) |
branch: scratch/ns/surface-stuff
commit 090ac3556cd0ee91de4709cfb2c5bcf222d799bb
Author: Alan Third <alan@idiocy.org>
Commit: Alan Third <alan@idiocy.org>
Make the NS buffer copy happen before we need it
* src/nsterm.m ([EmacsView viewWillDraw]): Move releaseContext to
updateLayer.
([EmacsView updateLayer]): Send a request for getContext, which will
copy the buffer and create the context if it doesn't already exist, to
the NS run loop.
---
src/nsterm.m | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/nsterm.m b/src/nsterm.m
index 6b6ad0c..f616824 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -8482,8 +8482,6 @@ not_in_argv (NSString *arg)
unblock_input ();
waiting_for_input = owfi;
}
-
- [surface releaseContext];
}
@@ -8515,7 +8513,11 @@ not_in_argv (NSString *arg)
There's a private method, -[CALayer setContentsChanged], that we
could use to force it, but we shouldn't often get the same
surface twice in a row. */
+ [surface releaseContext];
[[self layer] setContents:(id)[surface getSurface]];
+ [surface performSelectorOnMainThread:@selector (getContext)
+ withObject:nil
+ waitUntilDone:NO];
}
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- scratch/ns/surface-stuff 090ac35: Make the NS buffer copy happen before we need it,
Alan Third <=