Repository navigation
Replies: 4 comments 1 reply
|
JD Smith ***@***.***> writes:
@gerd-moellmann mentioned the use of [NSApp run] by the NS build as an issue. As @exlee pointed out, emacs-mac also runs
this a lot. It happens during runTemporarilyWithBlock:
https://github.com/jdtsmith/emacs-mac/blob/676e9332e8a4be8863656d35b651bb4bd00c13f0/src/macappkit.m#L506C1-L535C2
which quickly spins the event loop whenever needed. Does this differ
significantly from how NS uses temporary runs?
What NS does is, roughly
1. Put an application-defined event in the event queue
2. Call -[NSApp run]
3. Expect -[EmacsApp sendEvent] will be called by the event loop code to
distribute events. When -[EmacsApp sendEvent] receives an app-defined
event, it does an -[NSApp stop] which returns to the caller in 2.
Problem is that this event trick doesn't always work, and we don't
return to the caller in 2. Reason unknown, not reproducible.
As one can see in the code you linked to, this is completely different
from NS. There are no events, and so on.
|
0 replies
|
There is this Lines 489 to 504 in 676e933 Does that differ substantially from the application-event NS uses? |
0 replies
|
JD Smith ***@***.***> writes:
There is this dummyEvent:
https://github.com/jdtsmith/emacs-mac/blob/676e9332e8a4be8863656d35b651bb4bd00c13f0/src/macappkit.m#L489-L504
Does that differ substantially from the application-event NS uses?
Not sure what you mean exactly. The use of the application-defined
events is completely different, yes, but don't ask me why at some points
that method is called to produce an application-defined event. I don't
know.
|
1 reply
|
JD Smith ***@***.***> writes:
Sorry for the vagueness, trying to triangulate the two different (NS
vs. Mac) event/thread/runloop models in my mind. Maybe a nice diagram
would be useful (even for the NS people).
Yeah, that might be helpful, but I suspect that someone did know
something what wasn't written down anywhere :-).
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
@gerd-moellmann mentioned the use of [NSApp run] by the NS build as an issue. As @exlee pointed out, emacs-mac also runs this a lot. It happens during
runTemporarilyWithBlock:emacs-mac/src/macappkit.m
Lines 506 to 535 in 676e933
which quickly spins the event loop whenever needed. Does this differ significantly from how NS uses temporary runs?
All reactions