Hey Alan,

Thank you for your reply!

> merge 31795 28512

Apparently, my search-fu has failed me as I didn't know about ticket 28512
before submitting new one. Thanks for linking.

That ticket actually reveals some insights on why the whole thing with
borderless mask doesn't behave as I want it to behave. As you say in your
message:

> Apparently macOS doesn’t like you changing the window style on the fly, and
> resizing breaks.

As it turns out, you can achieve goal by creating a window without
NSWindowStyleMaskTitled regardless the undecorated flag value. It's not a
solution in general way, but in case someone is interested, I can share a patch.

Though it would be nice to make it working with undecorated frame option.

> and switch to using NSFullSizeContentViewWindowMask and its relatives.

I should try this out.

> Hmm, this isn’t very good. Maybe we should be resetting the window style
> before and after toggling fullscreen.

Maybe. Because (let's say) it's not useful as is :)

> I would expect that to work.

OK, so I am not the only one :)

> Is the line break just because of your email client?

Exactly. Originally I've put it in one line.

>> and creating EmacsFSWindow instead of EmacsWindow (so canBecomeKeyWindow
>> and canBecomeMainWindow both return YES).

> You don’t need this. IIRC EmacsFSWindow exists solely for non‐native
> fullscreen.

I was desperate.

On Tue, 12 Jun 2018 at 23:07, Alan Third <alan@idiocy.org> wrote:
merge 31795 28512
thank you

On Mon, Jun 11, 2018 at 09:38:57PM +0300, Boris Buliga wrote:
<create an undecorated frame>
> 3. Try one of the following actions
>
> 3.1. M-x toggle-frame-fullsreen
>
>      Frames' window (in macOS sense) becomes fullscreen. But it doesn't
>      cover all screen, instead it remains of the same default size with
>      black area around.

Hmm, this isn’t very good. Maybe we should be resetting the window
style before and after toggling fullscreen.

> 3.2. Use Spectacle.app (or similar application for resizing windows in
>      macOS)
>
>      Frame is not resized.

Unfortunately this is expected. Apparently macOS doesn’t like you
changing the window style on the fly, and resizing breaks. The
solution appears to be to recreate the NSWindow, or give up on
NSWindowStyleMaskBorderless and switch to using
NSFullSizeContentViewWindowMask and its relatives.

> I've tried patching src/nsterm.m file by chaning definition of
> FRAME_DECORATED_FLAGS from
>
>   #define FRAME_UNDECORATED_FLAGS NSWindowStyleMaskBorderless
>
> to
>
>   #define FRAME_UNDECORATED_FLAGS NSWindowStyleMaskBorderless |
>    NSWindowStyleMaskResizable

I would expect that to work. Is the line break just because of your
email client? If not then you need to escape the newline like this:

    #define FRAME_UNDECORATED_FLAGS NSWindowStyleMaskBorderless \
                                    | NSWindowStyleMaskResizable


> and creating EmacsFSWindow instead of EmacsWindow (so canBecomeKeyWindow
> and canBecomeMainWindow both return YES).

You don’t need this. IIRC EmacsFSWindow exists solely for non‐native
fullscreen.

--
Alan Third


--
Cheers,
Boris