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

From: 川本 琢二 (Dr.Sc.KAWAMOTO,Takuji)<[email-masked]>
Date: Sun, 3 Aug 2025 16:07:41 +0900

As part of the investigation for this bug, I created an external helper 
command called `listemacswindows_cocoa`, which reports window frame 
information from the macOS side. I also added logging in Emacs to 
compare its internal state with the output of this external tool.

Below is the log output before applying the proposed patch, when 
resizing from the left edge of the frame:

#### Resize from left edge (before patch)

2025-08-03 08:16:01.306027 ELisp after resize-hook 1924x975-1920+0 
1924x975-1920+0
2025-08-03 08:16:08.873112 Obj-C windowWillResize called
2025-08-03 08:16:08.875086 Obj-C windowDidMove called
2025-08-03 08:16:08.984022 ELisp after resize-hook 1917x975-1920+0 
1924x975-1920+0
...
2025-08-03 08:16:09.835766 ELisp after move-hook 1902x975-1901+0 
1902x975-1898+0

As you can see, the ELisp hooks (both `window-size-change-functions` and 
`move-frame-functions`) do not reflect the final window position 
correctly during resizing from the left edge.

After applying the patch, the log becomes:

#### Resize from left edge (after patch)

2025-08-03 09:46:54.217436 Obj-C windowWillResize called
2025-08-03 09:46:54.218742 Obj-C windowDidMove called
2025-08-03 09:46:54.218765 Obj-C updateFramePosition called 
1882x910-1882+56
2025-08-03 09:46:54.328541 ELisp after resize-hook 1876x938-1882+31 
1882x938-1882+31
...
2025-08-03 09:46:54.979835 ELisp after move-hook 1871x938-1871+31 
1871x938-1871+31

The logging confirms that with the patch, the position and size 
information reported to Lisp is now correctly updated after the resize 
operation.

This should resolve the issue where `move-frame-functions` failed to 
receive the final frame location during left-edge resizing.