rxhanson / Rectangle

Move and resize windows on macOS with keyboard shortcuts and snap areas
https://rectangleapp.com
Other
25.13k stars 744 forks source link

App windows randomly misplaced upon waking from sleep on multiple monitors #1234

Open JamIsJam88 opened 11 months ago

JamIsJam88 commented 11 months ago

macOS version: Sonoma 14.0 Public Beta (23A5312d) Rectangle version: 0.70 (76) Logs if applicable (In Rectangle menu, hold option, "View Logging..."): None

I noticed since the latest Rectangle update that the windows for all my apps randomly relocate when waking from sleep on multiple monitors. Every time I wake the Mac from sleep, I have to readjust them to where they were before.

rxhanson commented 11 months ago

Thanks for reporting. Does this happen when Rectangle is not running?

alewis001 commented 7 months ago

I don't know whether I'm seeing something similar/related. I find that after sleep/lock, windows are being centered after unlocking. I haven't tried without Rectangle running as until now I didn't know whether it might be a stage manager "behaviour" or something to do with Rectangle. I'll rearrange my windows now, stop rectangle and then I'll see what it's like in the morning.

alewis001 commented 7 months ago

Unlocking my machine, with rectangle not running, and the windows were again centred. So from that test, it would appear that this issue isn't with Rectangle. The windows that appear to be affected are ones that have been sized to the left or right of the screen (I.e. full height, half screen width); those windows are pushed to the centre after unlock.

Is there anything about the sizing and positioning that rectangle does when moving a window to the sides of the screen that could be lost or incompatible in some way when macos comes out of sleep/lock, even if rectangle isn't running? If not, then it would seem that my issue is a Sonoma (or Sonoma + stage manager) one, not rectangle.

I'll check through the Rectangle docs to see if there is logging I can turn on.

Regardless, I don't want my comments to detract from what @JamIsJam88 is seeing as my issue may be separate from theirs.

alewis001 commented 7 months ago

Here is some logging.

2023-11-13T09:01:08Z: AX sizing proposed: (1920.0, 2135.0), result: (1920.0, 2135.0)
2023-11-13T09:01:08Z: AX position proposed: (0.0, 25.0), result: (0.0, 25.0)
2023-11-13T09:01:08Z: AX sizing proposed: (1920.0, 2135.0), result: (1920.0, 2135.0)
2023-11-13T09:01:08Z: leftHalf | display: (0.0, 0.0, 3840.0, 2135.0), calculatedRect: (0.0, 25.0, 1920.0, 2135.0), resultRect: (0.0, 25.0, 1920.0, 2135.0), srcScreen: PL3272UH, destScreen: PL3272UH, resultScreen: PL3272UH
2023-11-13T09:02:01Z: AX sizing proposed: (1920.0, 2135.0), result: (1920.0, 2135.0)
2023-11-13T09:02:01Z: AX position proposed: (0.0, 25.0), result: (0.0, 25.0)
2023-11-13T09:02:01Z: AX sizing proposed: (1920.0, 2135.0), result: (1920.0, 2135.0)
2023-11-13T09:02:01Z: leftHalf | display: (0.0, 0.0, 3840.0, 2135.0), calculatedRect: (0.0, 25.0, 1920.0, 2135.0), resultRect: (0.0, 25.0, 1920.0, 2135.0), srcScreen: PL3272UH, destScreen: PL3272UH, resultScreen: PL3272UH
2023-11-13T09:02:04Z: AX sizing proposed: (1920.0, 2135.0), result: (1920.0, 2135.0)
2023-11-13T09:02:04Z: AX position proposed: (1920.0, 25.0), result: (1920.0, 25.0)
2023-11-13T09:02:04Z: AX sizing proposed: (1920.0, 2135.0), result: (1920.0, 2135.0)
2023-11-13T09:02:04Z: rightHalf | display: (0.0, 0.0, 3840.0, 2135.0), calculatedRect: (1920.0, 25.0, 1920.0, 2135.0), resultRect: (1920.0, 25.0, 1920.0, 2135.0), srcScreen: PL3272UH, destScreen: PL3272UH, resultScreen: PL3272UH
2023-11-13T09:02:09Z: Failed to find frontmost window.
2023-11-13T10:01:55Z: Failed to find frontmost window.
2023-11-13T10:01:59Z: Failed to find frontmost window.

I'd moved some windows to the left or right hand sides of the screen and locked my machine at 9:02. I then unlocked my machine at 10:01. Those that I had moved to the sides are now in the center of the screen; their dimensions are still the same.

Is that Failed to find frontmost window. indicative of a/the problem or is it normal?

I should add that I also use multiple desktops and the issue does not a single application. I've seen it with iterm2, chrome windows. Those are the type I tend to have docked to the left or right of the screen; otherwise, I have a window centered and it quite often will be maximised in the case of iterm2.

rxhanson commented 7 months ago

@alewis001 thanks for the additional details. Unfortunately, the issue is on the macOS side. I don't have plans to modify Rectangle to account for this, as it's an edge case that is hard to handle in a robust way.

alewis001 commented 7 months ago

@alewis001 thanks for the additional details. Unfortunately, the issue is on the macOS side. I don't have plans to modify Rectangle to account for this, as it's an edge case that is hard to handle in a robust way.

No problem at all, and totally understood. I've found that if I move the window a little away from an edge, the issue doesn't happen any more, and it's very easy with the keyboard shortcuts to send a window to an edge anyway, so it's no biggie for me.