emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: redisplay and expose_frame


From: Alan Third
Subject: Re: redisplay and expose_frame
Date: Tue, 24 Jul 2018 21:42:20 +0100
User-agent: Mutt/1.10.0 (2018-05-17)

On Mon, Jul 23, 2018 at 06:58:22PM +0900, YAMAMOTO Mitsuharu wrote:
> On Sun, 22 Jul 2018 21:44:18 +0900,
> Alan Third wrote:
> 
> > The background here is that I’m working on splitting the NS port’s GUI
> > code into its own thread, and while working on that I noticed that
> > Apple have deprecated the method we use to draw, so I thought that
> > since I’m working with the code anyway, I may as well try to
> > ‘modernise’ it.
> 
> A related thread can be found around
> http://lists.gnu.org/archive/html/emacs-devel/2010-07/msg00821.html .

That’s interesting, and confirms some of what I’d thought. I take it
nothing ever came of it, though?

> Mojave, the next version of macOS, already prohibits drawing outside
> "drawRect:" by default if the executable was linked on that version.
> An attempt to draw outside "drawRect:" triggers invalidation of all
> the contents instead, and it is completely redrawn (even for a single
> cursor movement) via "drawRect:" at the next cycle of the event loop.
> This is kinda usable for small frames on recent machines, but not
> efficient of course, especially for full screen frames.

This doesn’t sound good, and I wonder if bug#31904 is related,
although it doesn’t sound like it should be.

Is the Mac port affected by this, or does it avoid this Cocoa stuff?

I suppose, to avoid changes in redisplay code, I could make the NS
drawing functions detect whether they are running in the main thread
(or perhaps they can just ask whether they’re able to draw or not),
and if they’re not then invalidate the relevant rectangle, and if they
are then do the actual drawing task.

Then call display for each frame to force an expose ‘event’ at the end
of redisplay.

-- 
Alan Third



reply via email to

[Prev in Thread] Current Thread [Next in Thread]