Subject: Re: bug#79164: frame position not updated correctly when resizing from left edge on macOS

From: 川本 琢二 (Dr.Sc.KAWAMOTO,Takuji)<[email-masked]>
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)"<[email-masked]> 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)<[email-masked]>
>>>>
>>>> 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.