unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Cc: Eli Zaretskii <eliz@gnu.org>,
	halley@play-bow.org, gongyi.liao@gmail.com, emacs-devel@gnu.org
Subject: Re: UI input unresponsive on macOS
Date: Sat, 2 Dec 2017 16:51:46 +0000	[thread overview]
Message-ID: <20171202165146.GA6174@breton.holly.idiocy.org> (raw)
In-Reply-To: <wlbmk0wi1a.wl%mituharu@math.s.chiba-u.ac.jp>

On Sat, Nov 18, 2017 at 09:24:17AM +0900, YAMAMOTO Mitsuharu wrote:
> 
> > NS GUI elements need to be handled in the main thread and it’s easy
> > enough to check whether we’re in the main thread before trying to
> > display the dialogue box.
> 
> Not just for creating a dialog box, but also for an ordinary Emacs
> frame (it does not always crash, but it sometimes does).  As I said,
> the Main Thread Checker makes it easier to detect these cases.
> 
> The Main Thread Checker reports even if you try to move/resize an
> existing NSWindow in a non-main thread.  Actually even -[NSView frame]
> seems to be black-listed.

Yes, this looks like it could be a very large job as lots of functions
will need a main thread guard. Even something as innocent looking as
setting a frame parameter causes an error.

I put a guard in the dialog box code and tried the original code again

    (make-thread #'gnus "gnus")

and it threw up a warning in redisplay, so I suppose we’ll have to
prevent redisplay happening in a sub‐thread.

    2017-12-02 16:36:15.551 Emacs[6922:22033201] Warning: Illegal attempt to access GUI elements from sub-thread.
    CoreAnimation: warning, deleted thread with uncommitted CATransaction; created by:
    <snip backtrace>
-- 
Alan Third



  reply	other threads:[~2017-12-02 16:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-03 13:36 UI input unresponsive on macOS Bob Halley
2017-01-03 14:36 ` Alan Third
2017-01-03 15:39   ` Bob Halley
2017-01-03 16:59   ` Bob Halley
2017-01-03 17:49     ` Alan Third
2017-01-04  3:52       ` Gong-Yi Liao 廖宮毅
2017-01-04 15:38         ` Eli Zaretskii
2017-01-05  4:34           ` Gong-Yi Liao 廖宮毅
2017-01-05 15:37             ` Eli Zaretskii
2017-01-05 17:00               ` Gong-Yi Liao 廖宮毅
2017-10-05  3:40                 ` YAMAMOTO Mitsuharu
2017-11-16 19:33                   ` Alan Third
2017-11-17  1:05                     ` YAMAMOTO Mitsuharu
2017-11-17 13:53                     ` Eli Zaretskii
2017-11-17 17:42                       ` Alan Third
2017-11-18  0:24                         ` YAMAMOTO Mitsuharu
2017-12-02 16:51                           ` Alan Third [this message]
2017-01-04 21:09   ` Alan Third

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171202165146.GA6174@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=gongyi.liao@gmail.com \
    --cc=halley@play-bow.org \
    --cc=mituharu@math.s.chiba-u.ac.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).