Rectangle icon indicating copy to clipboard operation
Rectangle copied to clipboard

Rectangle fails to move Emacs after system sleep

Open deg opened this issue 4 months ago • 3 comments

  • [ ] This is a new bug that hasn't been documented in a closed issue or in the Readme.

macOS version: Sequoia 15.0.1 on a MacBook Pro M2 Rectangle version: 0.89 (95) Logs if applicable (In Rectangle menu, hold option, "View Logging..."): attached below

Apologies that this is going to be a weak bug report. Hope the log adds enough context.

This problem started a few months ago, possibly after I upgraded either Rectangle or Emacs -- it did not happen previously.

When Emacs first starts, Rectangle works fine on it. However after a while -- very likely after a sleep, Emacs ceases to respond properly to Rectangle. It does get set to the correct size, but its position is not set.

Also, after a sleep, it is always in the wrong position; usually about half a screen too low and a bit to the right.

Other notes that may be relevant.

  • This all worked fine until a few months ago.
  • I'm running Emacs 29.4
  • I have two external screens on my Mac, both to the left of the Macbook, and taller (so you'll see negative coordinates in the log). I usually run Emacs on the left half of my large center screen.
  • I do have a fairly complex Emacs init. I don't think it is a direct cause of the problem, since Rectangle+Emacs worked fine previously with the same init. I can't easily test in a bare Emacs, since the problem seems to only develop after a while and I need Emacs and my init most of my day.

Here's a log of several attempts to resize Emacs on both my central screen and also on the Macbook screen.

2025-08-18T13:41:06+03:00: AX sizing proposed: (1720.0, 1415.0), result: (1715.0, 1412.0) 2025-08-18T13:41:06+03:00: AX position proposed: (-3440.0, -433.0), result: (-3440.0, -433.0) 2025-08-18T13:41:06+03:00: AX sizing proposed: (1720.0, 1415.0), result: (1715.0, 1412.0) 2025-08-18T13:41:06+03:00: leftHalf, display: (-3440.0, 0.0, 3440.0, 1415.0), calculatedRect: (-3440.0, -433.0, 1720.0, 1415.0), resultRect: (-3440.0, -433.0, 1715.0, 1412.0), srcScreen: Mi Monitor, destScreen: Mi Monitor, resultScreen: Mi Monitor 2025-08-18T13:41:13+03:00: AX sizing proposed: (1720.0, 1415.0), result: (1715.0, 1412.0) 2025-08-18T13:41:13+03:00: AX position proposed: (-3440.0, -433.0), result: (-3440.0, -433.0) 2025-08-18T13:41:13+03:00: AX sizing proposed: (1720.0, 1415.0), result: (1715.0, 1412.0) 2025-08-18T13:41:13+03:00: leftHalf, display: (-3440.0, 0.0, 3440.0, 1415.0), calculatedRect: (-3440.0, -433.0, 1720.0, 1415.0), resultRect: (-3440.0, -433.0, 1715.0, 1412.0), srcScreen: Mi Monitor, destScreen: Mi Monitor, resultScreen: Mi Monitor 2025-08-18T13:41:28+03:00: AX sizing proposed: (1720.0, 1415.0), result: (1715.0, 182.0) 2025-08-18T13:41:28+03:00: AX position proposed: (-2580.0, -433.0), result: (-2580.0, -433.0) 2025-08-18T13:41:28+03:00: AX sizing proposed: (1720.0, 1415.0), result: (1715.0, 1412.0) 2025-08-18T13:41:28+03:00: centerHalf, display: (-3440.0, 0.0, 3440.0, 1415.0), calculatedRect: (-2580.0, -433.0, 1720.0, 1415.0), resultRect: (-2580.0, -433.0, 1715.0, 1412.0), srcScreen: Mi Monitor, destScreen: Mi Monitor, resultScreen: Mi Monitor 2025-08-18T13:41:34+03:00: AX sizing proposed: (1720.0, 1415.0), result: (1715.0, 1412.0) 2025-08-18T13:41:34+03:00: AX position proposed: (-3440.0, -433.0), result: (-3440.0, -433.0) 2025-08-18T13:41:34+03:00: AX sizing proposed: (1720.0, 1415.0), result: (1715.0, 1412.0) 2025-08-18T13:41:34+03:00: leftHalf, display: (-3440.0, 0.0, 3440.0, 1415.0), calculatedRect: (-3440.0, -433.0, 1720.0, 1415.0), resultRect: (-3440.0, -433.0, 1715.0, 1412.0), srcScreen: Mi Monitor, destScreen: Mi Monitor, resultScreen: Mi Monitor 2025-08-18T13:41:35+03:00: AX sizing proposed: (1720.0, 1415.0), result: (1715.0, 1412.0) 2025-08-18T13:41:35+03:00: AX position proposed: (-1720.0, -433.0), result: (-1720.0, -433.0) 2025-08-18T13:41:35+03:00: AX sizing proposed: (1720.0, 1415.0), result: (1715.0, 1412.0) 2025-08-18T13:41:35+03:00: rightHalf, display: (-3440.0, 0.0, 3440.0, 1415.0), calculatedRect: (-1720.0, -433.0, 1720.0, 1415.0), resultRect: (-1720.0, -433.0, 1715.0, 1412.0), srcScreen: Mi Monitor, destScreen: Mi Monitor, resultScreen: Mi Monitor 2025-08-18T13:41:37+03:00: AX sizing proposed: (1146.0, 707.0), result: (1139.0, 707.0) 2025-08-18T13:41:37+03:00: AX position proposed: (-2294.0, -433.0), result: (-2294.0, -433.0) 2025-08-18T13:41:37+03:00: AX sizing proposed: (1146.0, 707.0), result: (1139.0, 707.0) 2025-08-18T13:41:37+03:00: topCenterSixth, display: (-3440.0, 0.0, 3440.0, 1415.0), calculatedRect: (-2294.0, -433.0, 1146.0, 707.0), resultRect: (-2294.0, -433.0, 1139.0, 707.0), srcScreen: Mi Monitor, destScreen: Mi Monitor, resultScreen: Mi Monitor 2025-08-18T13:41:42+03:00: AX sizing proposed: (1146.0, 707.0), result: (1139.0, 707.0) 2025-08-18T13:41:42+03:00: AX position proposed: (-1146.0, -433.0), result: (-1146.0, -433.0) 2025-08-18T13:41:42+03:00: AX sizing proposed: (1146.0, 707.0), result: (1139.0, 707.0) 2025-08-18T13:41:42+03:00: topRightSixth, display: (-3440.0, 0.0, 3440.0, 1415.0), calculatedRect: (-1146.0, -433.0, 1146.0, 707.0), resultRect: (-1146.0, -433.0, 1139.0, 707.0), srcScreen: Mi Monitor, destScreen: Mi Monitor, resultScreen: Mi Monitor 2025-08-18T13:41:43+03:00: AX sizing proposed: (1720.0, 1415.0), result: (1139.0, 1412.0) 2025-08-18T13:41:43+03:00: AX position proposed: (-1720.0, -433.0), result: (-1720.0, -433.0) 2025-08-18T13:41:43+03:00: AX sizing proposed: (1720.0, 1415.0), result: (1715.0, 1412.0) 2025-08-18T13:41:43+03:00: rightHalf, display: (-3440.0, 0.0, 3440.0, 1415.0), calculatedRect: (-1720.0, -433.0, 1720.0, 1415.0), resultRect: (-1720.0, -433.0, 1715.0, 1412.0), srcScreen: Mi Monitor, destScreen: Mi Monitor, resultScreen: Mi Monitor 2025-08-18T13:41:45+03:00: AX sizing proposed: (1146.0, 707.0), result: (1139.0, 707.0) 2025-08-18T13:41:45+03:00: AX position proposed: (-3440.0, -433.0), result: (-3440.0, -433.0) 2025-08-18T13:41:45+03:00: AX sizing proposed: (1146.0, 707.0), result: (1139.0, 707.0) 2025-08-18T13:41:45+03:00: topLeftSixth, display: (-3440.0, 0.0, 3440.0, 1415.0), calculatedRect: (-3440.0, -433.0, 1146.0, 707.0), resultRect: (-3440.0, -433.0, 1139.0, 707.0), srcScreen: Mi Monitor, destScreen: Mi Monitor, resultScreen: Mi Monitor

deg avatar Aug 18 '25 10:08 deg