GNU bug report logs - #79164
[PATCH] Fix macOS frame position update after resize/move in nsterm.m

Previous Next

Package: emacs;

Reported by: 川本 琢二 (Dr.Sc.KAWAMOTO,Takuji) <kawamoto.takuji <at> gmail.com>

Date: Sun, 3 Aug 2025 06:46:02 UTC

Severity: normal

Tags: patch

Done: Alan Third <alan <at> idiocy.org>

Full log


View this message in rfc822 format

From: 川本 琢二 (Dr.Sc.KAWAMOTO,Takuji)
 <kawamoto.takuji <at> gmail.com>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: 79164 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, Alan Third <alan <at> idiocy.org>
Subject: bug#79164: frame position not updated correctly when resizing from left edge on macOS
Date: Tue, 5 Aug 2025 20:20:16 +0900
Thank you for the reference.

Yes, I also noticed that Yamamoto-san’s `emacs-mac` port uses similar 
approaches
 to track window movement and resizing accurately on macOS.
 That gave me more confidence that this patch’s use of `windowDidMove` and
 `windowDidEndLiveResize` to update frame geometry is consistent with 
well-tested practice.

My patch aims to integrate such behavior into upstream Emacs so that 
even the standard
Cocoa build reports accurate frame positions during edge-resize 
operations—especially
for use cases relying on `move-frame-functions`.

Best regards,
Dr.Sc.KAWAMOTO, Takuji
On 2025/08/04 22:11, Gerd Möllmann wrote:
> "川本 琢二 (Dr.Sc.KAWAMOTO,Takuji)"<kawamoto.takuji <at> gmail.com> writes:
>
>> Thank you.
>>
>> For the record, the patch was applied and tested against the latest
>> master branch of Emacs as of 2025-07-20.
>> The base commit was:
>>
>>      commit e6c1ec71b72  [Define setfunction for
>> bibtex-generate-url-list (bug#78798)]
>>
>> I built and tested on macOS 15.5 (Sonoma) using native compilation
>> enabled (`--with-native-compilation`),
>>   and verified the fix by tracking both Emacs's internal frame state
>> and actual macOS-reported window
>> geometry during left-edge resize operations.
>>
>> Best regards,
>> Dr.Sc.KAWAMOTO, Takuji
>> On 2025/08/04 20:58, Eli Zaretskii wrote:
>>>> ate: Sun, 3 Aug 2025 15:45:25 +0900
>>>> From: 川本 琢二
>>>>    (Dr.Sc.KAWAMOTO, Takuji)<kawamoto.takuji <at> gmail.com>
>>>>
>>>> This patch addresses a bug in the macOS build of Emacs, where frame
>>>> position was not correctly updated after resizing from the left edge.
>>>>
>>>> In particular, it fixes the issue reported in bug#74074, where
>>>> the move-frame-functions hook does not reliably reflect the final
>>>> frame location after resizing. This patch introduces the
>>>> updateFramePosition method, which is called from windowDidMove
>>>> and windowDidEndLiveResize to ensure the frame geometry stays
>>>> in sync with the actual macOS window position.
>>>>
>>>> Tested on macOS 15.5.
>>> Thanks, I hope the macOS experts (CC'ed) will be able to review and
>>> test the patch.
>>>
>>> For the record: which Emacs version did you patch with this change?
> I'm afraid that goes beyond my knowledge. But I can say that
> Yamamoto-san's mac uses these methods, too:
>
>    https://github.com/jdtsmith/emacs-mac/blob/emacs-mac-30_1_exp/src/macappkit.m
>
> and it does seems to work correctly.




This bug report was last modified 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.