From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Aaron Jensen <aaronjensen@gmail.com>
Newsgroups: gmane.emacs.bugs
Subject: bug#28443: 26.0.50;
 Pause when fullscreening when ns-use-native-fullscreen is nil on macOS
Date: Sat, 16 Nov 2024 23:37:13 -0500
Message-ID: <CAHyO48yxZ0qY3vmScDL9SESxg0gohr+7HLXQTe0nWVMzNRdaOQ@mail.gmail.com>
References: <m2ingm23re.fsf@gmail.com>
 <20170913192737.GA31742@breton.holly.idiocy.org>
 <CAHyO48xj1un_T=vRs0=FfRnzcfyXRMBM1ad1APHJ8oU_cUnatQ@mail.gmail.com>
 <20170913201301.GB31742@breton.holly.idiocy.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="000000000000acab7c0627145a6c"
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="11944"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 28443@debbugs.gnu.org
To: Alan Third <alan@idiocy.org>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 17 05:39:13 2024
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1tCX45-0002zJ-68
	for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Nov 2024 05:39:13 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1tCX3x-0000dF-B0; Sat, 16 Nov 2024 23:39:05 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1tCX3v-0000cH-PN
 for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 23:39:03 -0500
Original-Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1tCX3v-0002ts-HT
 for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 23:39:03 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=debbugs.gnu.org; s=debbugs-gnu-org; 
 h=Date:From:References:In-Reply-To:Mime-Version:To:Subject;
 bh=oWE12nCqX9c4iAOZ+4nfVQdht+bMYrPG5kRybSM/ONg=; 
 b=fWMRmci3enY6+M6wSjcKe4PZpbkla7hFlcxb+dI1f/+4I/Tn9oqicpYtrN3uTo6lY01OGGovbK2olCd2E2pa0RvfdELoAtzhaV1HeruUuFKHMwAyd+5qApxij4YSPN6B1q5KuW21XpyxnsFC6qsLJm9b2ZO07yTzcaK5VeYExH4HDpOhJ/pFZvP/8RgYEdpttmAwhZvaxMt6qnT3HAaLYqlcNkYxd0WecSMuNczntxORhEnjYGqziRLefLiG2dJzkbkrOjiSeRX+EZq/GzQPS/apgTTotVWv5KITSKcBs9KJBd/JNSoWPQ2QCCgCiGT1VxtpvRhi5K1+l6SPVzihig==;
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tCX3u-0002iD-Be
 for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 23:39:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Aaron Jensen <aaronjensen@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sun, 17 Nov 2024 04:39:02 +0000
Resent-Message-ID: <handler.28443.B28443.173181830010359@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 28443
X-GNU-PR-Package: emacs
Original-Received: via spool by 28443-submit@debbugs.gnu.org id=B28443.173181830010359
 (code B ref 28443); Sun, 17 Nov 2024 04:39:02 +0000
Original-Received: (at 28443) by debbugs.gnu.org; 17 Nov 2024 04:38:20 +0000
Original-Received: from localhost ([127.0.0.1]:55482 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1tCX3D-0002h1-F5
 for submit@debbugs.gnu.org; Sat, 16 Nov 2024 23:38:19 -0500
Original-Received: from mail-lj1-f179.google.com ([209.85.208.179]:56438)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <aaronjensen@gmail.com>) id 1tCX39-0002gr-Mo
 for 28443@debbugs.gnu.org; Sat, 16 Nov 2024 23:38:17 -0500
Original-Received: by mail-lj1-f179.google.com with SMTP id
 38308e7fff4ca-2ff550d37a6so30952231fa.0
 for <28443@debbugs.gnu.org>; Sat, 16 Nov 2024 20:38:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1731818234; x=1732423034; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:references:in-reply-to
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=Xva9WLars3ckh5fJ/PhWXM7rlPhPErwRxmcqhI2HL9g=;
 b=Ns2pwntJjWbhlvroBo9QEctjqMYYqwZlB13zQxPqsoxjTmUgjteTBOi9hi7UHUFxgW
 OOhlW66eiTcKsPDJlinE2Yr1uxKfqPu6iTgoQPgIYZAlovp5n6cM36M14cITqXGi1zop
 7SQ61py8+uNctmR1wBRyJnBZU45rWJEKiROL0G43w9uMSJH2+NBhs/V/4V+vzphItwwU
 p93gqLOqMLbIIqCxgghNVASBpR3eqldKmGl+tF1E9sFedrOgUR9FTON90Tbn0FCzz562
 3jmrsq1xn3Wu1/PIHxTpARis3/d0h4WsrcVm1NsFsaQtrfoWaaZ0ZORFdRAiOVP2I7J4
 RhEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1731818234; x=1732423034;
 h=cc:to:subject:message-id:date:from:references:in-reply-to
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=Xva9WLars3ckh5fJ/PhWXM7rlPhPErwRxmcqhI2HL9g=;
 b=Qiqz6Vc3rqcr4U0agd9/t5dr/yDU8iifsmEdQ8ZXhQHl+4Ml6FZTR9Eyd/Ychyz6+h
 RIIYQ797ND4Ase5dKkilLY8/uYRr1WxiNxWp2eJGrbTfGRNmdSX2YANJ5jFRs/sEjpJN
 JNvPnRsveQITVZDeSozSDt7Qr6Gl0WdXxx/9yhsX9GPUFhhTdyeBePqeIa/3ge1MGmMh
 5jL0M4b/cMuv2PtI97qS+KdW/UyKmvV3U2eYB+7dTwZECw0S+eNTKrfxjF0f7KubLhn0
 O/EJ3d7/n+FLmKLpZiz/g+qfP29O/upK/3Yz8TXpu550FoCygsoN3LizYMwNskeHlfgA
 o4RA==
X-Gm-Message-State: AOJu0YxpbRrUcs5LlyGbXLtv08yypO3zgcdCBx9b7xXFTvJXdmXXubsR
 8+VjHyLM4Wxj26aEpmVcc9UDnBr/S83RF47cH1awJdXNEM9FErHcSJWK4L0wPFh9GJ7uRPWSHYj
 9RitIoxDjL8pf0hj9+Cs5IF05kqk92g==
X-Google-Smtp-Source: AGHT+IF3Kvb218xqtjMhzXBlNMUisV47T81MRSTR/iJ+awHn8ug0esY2hqmaIvFqR64oPVebI0WjG7nwHQGdNixbNCU=
X-Received: by 2002:a2e:9a0f:0:b0:2ff:59e9:98b7 with SMTP id
 38308e7fff4ca-2ff609be354mr34806891fa.37.1731818234350; Sat, 16 Nov 2024
 20:37:14 -0800 (PST)
Original-Received: from 649336022844 named unknown by gmailapi.google.com with
 HTTPREST; Sat, 16 Nov 2024 23:37:13 -0500
X-Mailer: Superhuman Desktop (2024-11-13T20:05:52Z)
X-Superhuman-Draft-ID: draft0082f3ae96a108ec
X-Superhuman-ID: m3l3ukhk.06fa4467-5ac6-4d83-baf2-275b16f90453
In-Reply-To: <20170913201301.GB31742@breton.holly.idiocy.org>
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Xref: news.gmane.io gmane.emacs.bugs:295504
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/295504>

--000000000000acab7c0627145a6c
Content-Type: multipart/alternative; boundary="000000000000acab7a0627145a6a"

--000000000000acab7a0627145a6a
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I can no longer reproduce any issues with setting the frame-default-alist,
so this patch removes the timer workaround. I'm using macOS 15.1, no idea
if that's relevant or not.


Aaron


On Wed, Sep 13, 2017 at 1:13 PM, Alan Third <alan@idiocy.org> wrote:

> On Wed, Sep 13, 2017 at 12:33:48PM -0700, Aaron Jensen wrote:
>
> On Wed, Sep 13, 2017 at 12:27 PM, Alan Third <alan@idiocy.org> wrote:
>
> On Wed, Sep 13, 2017 at 05:15:49AM -0700, Aaron Jensen wrote:
>
> When ns-use-native-fullscreen is nil and a frame is set to fullscreen,
> there is a slight pause before the frame goes fullscreen. I believe the
> pause is about the same length as the animation when native fullscreen is
> used, so I'm wondering if there's some timing code in there that can be
> disabled when non-native fullscreen is being used.
>
> Found it. In ns_fullscreen_hook in nsterm.m there is a timer:
>
> /* Old style fs don't initiate correctly if created from
> init/default-frame alist, so use a timer (not nice...).
> */
> [NSTimer scheduledTimerWithTimeInterval: 0.5 target: view selector:
> @selector (handleFS)
> userInfo: nil repeats: NO];
>
> if I replace the timer with
>
> [view handleFS]
>
> it works absolutely fine, but I have to assume there are situations where
> it doesn=E2=80=99t.
>
> My guess is that the timer was there to sync w/ the animation. If the
> animation is disabled, there shouldn't be a timer, but if it is, there
> should be. This is just a guess.
>
> I should have read it a bit more closely. The comment=E2=80=99s saying th=
ere=E2=80=99s a
> problem when
>
> (add-to-list =E2=80=99frame-default-alist =E2=80=99(fullscreen . fullboth=
))
>
> is used, and sure enough, when I set it and create a new frame, it draws
> incorrectly.
>
> I notice that changing back from fullscreen results in the top of the
> emacs window being hidden behind the toolbar. Clearly non=E2=80=90native =
fullscreen
> has some resizing issues.
>
> It can be (correctly) emulated with:
>
> (set-frame-parameter nil 'undecorated t)
> (setq ns-auto-hide-menu-bar 1)
> (tool-bar-mode -1)
> (toggle-frame-maximized)
>
> which makes me wonder if we even need this code and could move it to lisp=
?
> --
> Alan Third
>

--000000000000acab7a0627145a6a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<html><head></head><body><div><div><div><div class=3D"">I can no longer rep=
roduce any issues with setting the frame-default-alist, so this patch remov=
es the timer workaround. I&#39;m using macOS 15.1, no idea if that&#39;s re=
levant or not.=C2=A0<br></div></div><div></div><br><div class=3D"gmail_sign=
ature"><div><br>Aaron</div><br></div></div><br><div><div class=3D"gmail_quo=
te">On Wed, Sep 13, 2017 at 1:13 PM, Alan Third <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:alan@idiocy.org" target=3D"_blank">alan@idiocy.org</a>&gt;</sp=
an> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
border-left:1px #ccc solid;padding-left:1ex"><div class=3D"gmail_extra"><di=
v class=3D"gmail_quote sh-color-black sh-color"><p class=3D"sh-color-black =
sh-color">On Wed, Sep 13, 2017 at 12:33:48PM -0700, Aaron Jensen wrote:
</p><blockquote class=3D"sh-color-black sh-color"><p class=3D"sh-color-blac=
k sh-color">
On Wed, Sep 13, 2017 at 12:27 PM, Alan Third &lt;<a target=3D"_blank" rel=
=3D"noopener noreferrer" href=3D"mailto:alan@idiocy.org" class=3D"sh-color-=
blue sh-color">alan@<wbr>idiocy.<wbr>org</a>&gt; wrote:
</p><blockquote class=3D"sh-color-black sh-color"><p class=3D"sh-color-blac=
k sh-color">
On Wed, Sep 13, 2017 at 05:15:49AM -0700, Aaron Jensen wrote:
</p><blockquote class=3D"sh-color-black sh-color"><p class=3D"sh-color-blac=
k sh-color">
When ns-use-native-fullscreen is nil and a frame is set to fullscreen,
there is a slight pause before the frame goes fullscreen. I believe the
pause is about the same length as the animation when native fullscreen
is used, so I&#39;m wondering if there&#39;s some timing code in there that=
 can
be disabled when non-native fullscreen is being used.
</p></blockquote><p class=3D"sh-color-black sh-color">
Found it. In ns_fullscreen_hook in nsterm.m there is a timer:
</p><p class=3D"sh-color-black sh-color">
/* Old style fs don&#39;t initiate correctly if created from
init/default-frame alist, so use a timer (not nice...).
<br>
*/
<br>
[NSTimer scheduledTimerWithTimeInterval: 0.5 target: view
selector: @selector (handleFS)
<br>
userInfo: nil repeats: NO];
</p><p class=3D"sh-color-black sh-color">
if I replace the timer with
</p><p class=3D"sh-color-black sh-color">
[view handleFS]
</p><p class=3D"sh-color-black sh-color">
it works absolutely fine, but I have to assume there are situations
where it doesn=E2=80=99t.
</p></blockquote><p class=3D"sh-color-black sh-color">
My guess is that the timer was there to sync w/ the animation. If the
animation is disabled, there shouldn&#39;t be a timer, but if it is, there
should be. This is just a guess.
</p></blockquote><p class=3D"sh-color-black sh-color">
I should have read it a bit more closely. The comment=E2=80=99s saying ther=
e=E2=80=99s
a problem when
</p><p class=3D"sh-color-black sh-color">
(add-to-list =E2=80=99frame-default-alist =E2=80=99(fullscreen . fullboth))
</p><p class=3D"sh-color-black sh-color">
is used, and sure enough, when I set it and create a new frame, it
draws incorrectly.
</p><p class=3D"sh-color-black sh-color">
I notice that changing back from fullscreen results in the top of the
emacs window being hidden behind the toolbar. Clearly non=E2=80=90native
fullscreen has some resizing issues.
</p><p class=3D"sh-color-black sh-color">
It can be (correctly) emulated with:
</p><p class=3D"sh-color-black sh-color">
(set-frame-parameter nil &#39;undecorated t)
<br>
(setq ns-auto-hide-menu-bar 1)
<br>
(tool-bar-mode -1)
<br>
(toggle-frame-maximized)
</p><p class=3D"sh-color-black sh-color">
which makes me wonder if we even need this code and could move it to
lisp?
<br>
--=20
<br>
Alan Third</p></div></div></blockquote></div></div><br></div></body></html>

--000000000000acab7a0627145a6a--

--000000000000acab7c0627145a6c
Content-Type: application/octet-stream; 
	name="0001-src-nsterm.m-ns_fullscreen_hook-Remove-timer-workaro.patch"
Content-Disposition: attachment; 
	filename="0001-src-nsterm.m-ns_fullscreen_hook-Remove-timer-workaro.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: 7b3a833be253fc8c_0.1

RnJvbSAxNzZlM2EzNDEwZTEyYmE1YjU5YzZkZGI5MjdjOGNiMzA5OWYzYjdmIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBBYXJvbiBKZW5zZW4gPGFhcm9uamVuc2VuQGdtYWlsLmNvbT4K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