emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs Mac port


From: YAMAMOTO Mitsuharu
Subject: Re: Emacs Mac port
Date: Mon, 19 Sep 2016 11:01:33 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shij┼Ź) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Sun, 18 Sep 2016 11:52:44 +0200, martin rudalics <address@hidden> said:

>> (Actually, the way to implement this screen updating during mouse
>> dragging on the Mac port interferes with "window snapping" introduced
>> in macOS 10.12, so it is disabled if running on that version.)

> So what do you do with "window snapping"?  Can you ask for a "white
> out"?

For "window snapping" introduced in macOS Sierra, see
https://www.youtube.com/watch?v=pzJGeTS49f4 .

The difficulty in updating the frame contents during resize by mouse
dragging on OS X/macOS comes from the fact that it is processed in a
modal loop.  To reflect the frame size change in Emacs, we have to go
back to Lisp event loop so it triggers redisplay, but the modal loop
does not allow us to do so.

Screen updating during mouse dragging is handled by generating fake
events press -> drag -> release -> press -> drag -> release -> ...
internally during a single dragging session.  Between (fake) release
and press, we go back to the Lisp event loop to trigger redisplay.

Unfortunately, this fake event generation does not work with "window
snapping" introduced in upcoming macOS 10.12 Sierra, probably because
the contextual information is lost by fragmented drag events.  I don't
want to make a frame all white as in the NS port, so I capture the
frame contents as a bitmap, decompose it to window (Emacs terminology)
contents, and distribute them proportionally during resize by mouse
dragging.

>> Rounding does not happen for the axis that is specified to be
>> maximized/full so that it does not leave spaces.  So, rounding happens
>> only for horizontal axis when the fullscreen frame parameter is set to
>> 'fullheight if `frame-resize-pixelwise' is nil.

> Sounds reasonable.  Hmm...

> Leaves me with one question: When do you suppress rounding with
> `frame-resize-pixelwise' nil?  Only for "for the axis that is specified
> to be maximized/full"?  Or are there other cases?

No other cases.  It is handled in the delegate method
windowWillResize:toSize: (you can think it as a callback) at
https://bitbucket.org/mituharu/emacs-mac/src/550234fa179601d4bace2cf32b693fc33f3d1266/src/macappkit.m?at=master&fileviewer=file-view-default#macappkit.m-2915
.

Rounding is done in the method hintedWindowFrameSize:allowsLarger: at 
https://bitbucket.org/mituharu/emacs-mac/src/550234fa179601d4bace2cf32b693fc33f3d1266/src/macappkit.m?at=master&fileviewer=file-view-default#macappkit.m-2302
.

                                     YAMAMOTO Mitsuharu
                                address@hidden



reply via email to

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