From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Boris Buliga Newsgroups: gmane.emacs.bugs Subject: bug#31795: 26.1; Undecorated frame resize issues on macOS Date: Wed, 13 Jun 2018 07:09:33 +0300 Message-ID: References: <20180612200748.GB889@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000020c615056e7e278c" X-Trace: blaine.gmane.org 1528862901 13536 195.159.176.226 (13 Jun 2018 04:08:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 13 Jun 2018 04:08:21 +0000 (UTC) Cc: 31795@debbugs.gnu.org To: alan@idiocy.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 13 06:08:17 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fSx4x-0003QZ-PN for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Jun 2018 06:08:16 +0200 Original-Received: from localhost ([::1]:59741 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSx75-0000Nu-1a for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Jun 2018 00:10:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSx6j-00009A-TB for bug-gnu-emacs@gnu.org; Wed, 13 Jun 2018 00:10:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSx6g-00055d-Jb for bug-gnu-emacs@gnu.org; Wed, 13 Jun 2018 00:10:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37734) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSx6g-00055V-CH for bug-gnu-emacs@gnu.org; Wed, 13 Jun 2018 00:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fSx6g-0005F7-1c for bug-gnu-emacs@gnu.org; Wed, 13 Jun 2018 00:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Boris Buliga Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Jun 2018 04:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31795 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31795-submit@debbugs.gnu.org id=B31795.152886299320133 (code B ref 31795); Wed, 13 Jun 2018 04:10:01 +0000 Original-Received: (at 31795) by debbugs.gnu.org; 13 Jun 2018 04:09:53 +0000 Original-Received: from localhost ([127.0.0.1]:45631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fSx6W-0005Ee-Qu for submit@debbugs.gnu.org; Wed, 13 Jun 2018 00:09:53 -0400 Original-Received: from mail-ot0-f171.google.com ([74.125.82.171]:33237) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fSx6U-0005ER-NL for 31795@debbugs.gnu.org; Wed, 13 Jun 2018 00:09:51 -0400 Original-Received: by mail-ot0-f171.google.com with SMTP id h6-v6so1434298otj.0 for <31795@debbugs.gnu.org>; Tue, 12 Jun 2018 21:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=d12frosted-io.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=g6SU0oyNyAWIp4d14VQYQUOEEiDisFYss6gjuIOIjyY=; b=mmZhDDq8Gkr6oi+GVQRc9ZgXNRE4+L42EIz0S1I5wPC17yvj4umtubjBZuUW8BlGD3 EgnyrhqPCJdZ5eJYRxDpjrhjSlT9T2HbrDXSJ2MxN+GunkC6bxsfbJzPS6AwwIbhhquf BzugKtB7ehs7x/VhiMu8o/HtK+hZKb2x32HtppzVsxz1ELTMijZaqAmpUgPlNdLhlxnW ixezt/yNEEIMfcT37fxZC6oBooDx5r+xpyxR5fm9VaPz9oWmnd425L4Yn5+hfaChtuF1 UkdOJNlhR+QZC0xgVnDMgImWVWgT/R761b3ADXVwKpId0CgXCgfdh3vtv5gG2cDxSCiu 1U4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=g6SU0oyNyAWIp4d14VQYQUOEEiDisFYss6gjuIOIjyY=; b=OFOOklL5+JI8wDQ0AV5hmwtgA7dyx0MiGVfjamUhL2xMdk6Wfq8B/r/u2dWEXTBeNi lxk1jM9dVJz1W9raN+fum896dqUcZE4Y3YzvtiWGdIBkATIYrWw8EEqnSpXrPDRiNNed NLimYFP0KBmeclteXQDAxIVcLAY3hpmLa6sJJytW/akqRMu7Ne4Dkz4aRuRoP517Dkvv 9PqwKvaPOvPrQ0sbvj/5Mpz/yL/716UgzD+BBOUAH0IPO2C0WjVXG0wm5OJapOMQeDC3 rc7VGL9RQh5TeGEKg9MIGjJFmdmmCZnJbzjUQnSxh0i8NgfeiY6dU6zhOkmkV5c1Wx7i U0Zg== X-Gm-Message-State: APt69E06GijnpEvil4Ktu1R5PIzcUs9XhY5sTDE5+7JDROXztdVCdgt3 w0vhYW+eFgt4eyak8V2Qy+2G2Akp2QBoQvMjW9pT1g== X-Google-Smtp-Source: ADUXVKKDGgspXbtSzUc8QxOCanGwN0bc4UcjH5x08cQskbnbk7Hz0mfabkSJQSRI1fvg/4TLBFTP/1Luw+bqWD+g10E= X-Received: by 2002:a9d:5250:: with SMTP id q16-v6mr1938062otg.229.1528862984941; Tue, 12 Jun 2018 21:09:44 -0700 (PDT) In-Reply-To: <20180612200748.GB889@breton.holly.idiocy.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:147355 Archived-At: --00000000000020c615056e7e278c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=E2=80=99t like you changing the window style on th= e 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=E2=80=99t very good. Maybe we should be resetting the windo= w 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=E2=80=99t need this. IIRC EmacsFSWindow exists solely for non=E2= =80=90native > fullscreen. I was desperate. On Tue, 12 Jun 2018 at 23:07, Alan Third wrote: > merge 31795 28512 > thank you > > On Mon, Jun 11, 2018 at 09:38:57PM +0300, Boris Buliga wrote: > > > 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=E2=80=99t very good. Maybe we should be resetting the windo= w > 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=E2=80=99t 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 canBecomeKeyWindo= w > > and canBecomeMainWindow both return YES). > > You don=E2=80=99t need this. IIRC EmacsFSWindow exists solely for non=E2= =80=90native > fullscreen. > > -- > Alan Third > --=20 Cheers, Boris --00000000000020c615056e7e278c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey Alan,

Thank you for your= reply!

> merge 31795 28512

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

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

> = Apparently macOS doesn=E2=80=99t like you changing the window style on the = fly, and
> resizing breaks.

As it tur= ns out, you can achieve goal by creating a window without
NSWindo= wStyleMaskTitled regardless the undecorated flag value. It's not a
solution in general way, but in case someone is interested, I can sha= re a patch.

Though it would be nice to make it wor= king with undecorated frame option.

> and switc= h to using NSFullSizeContentViewWindowMask and its relatives.
I should try this out.

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

M= aybe. 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 ju= st because of your email client?

Exactly. Original= ly I've put it in one line.

>> and creat= ing EmacsFSWindow instead of EmacsWindow (so canBecomeKeyWindow
&= gt;> and canBecomeMainWindow both return YES).

= > You don=E2=80=99t need this. IIRC EmacsFSWindow exists solely for non= =E2=80=90native
> fullscreen.

I was d= esperate.

On Tue, 12 J= un 2018 at 23:07, Alan Third <alan@id= iocy.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
>
>=C2=A0 =C2=A0 =C2=A0 Frames' window (in macOS sense) becomes fullsc= reen. But it doesn't
>=C2=A0 =C2=A0 =C2=A0 cover all screen, instead it remains of the same d= efault size with
>=C2=A0 =C2=A0 =C2=A0 black area around.

Hmm, this isn=E2=80=99t very good. Maybe we should be resetting the window<= br> style before and after toggling fullscreen.

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

Unfortunately this is expected. Apparently macOS doesn=E2=80=99t 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
>
>=C2=A0 =C2=A0#define FRAME_UNDECORATED_FLAGS NSWindowStyleMaskBorderles= s
>
> to
>
>=C2=A0 =C2=A0#define FRAME_UNDECORATED_FLAGS NSWindowStyleMaskBorderles= s |
>=C2=A0 =C2=A0 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:

=C2=A0 =C2=A0 #define FRAME_UNDECORATED_FLAGS NSWindowStyleMaskBorderless \=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | NSWindowStyleMaskRes= izable


> and creating EmacsFSWindow instead of EmacsWindow (so canBecomeKeyWind= ow
> and canBecomeMainWindow both return YES).

You don=E2=80=99t need this. IIRC EmacsFSWindow exists solely for non=E2=80= =90native
fullscreen.

--
Alan Third


--
Cheers,
Boris
--00000000000020c615056e7e278c--