Rectangle icon indicating copy to clipboard operation
Rectangle copied to clipboard

Very slow to perform window resizing or repositioning

Open krp312 opened this issue 3 years ago • 10 comments

Greetings,

Rectangle is suddenly taking several seconds to perform window resizing/repositioning.

MacOS: 12.6 Rectangle: 0.60 (66)

Video

Log:

2022-10-26T10:50:50-04:00: AX sizing proposed: (840.0, 1025.0), result: (840.0, 1025.0)
2022-10-26T10:50:50-04:00: AX position proposed: (840.0, 25.0), result: (840.0, 25.0)
2022-10-26T10:50:50-04:00: AX sizing proposed: (840.0, 1025.0), result: (840.0, 1025.0)
2022-10-26T10:50:50-04:00: rightHalf | display: (0.0, 0.0, 1680.0, 1025.0), calculatedRect: (840.0, 25.0, 840.0, 1025.0), resultRect: (840.0, 25.0, 840.0, 1025.0), srcScreen: Built-in Retina Display, destScreen: Built-in Retina Display, resultScreen: Built-in Retina Display

Many thanks in advance!

krp312 avatar Oct 26 '22 15:10 krp312

I forgot to add that this seems to be occurring for all programs, and all types of window resize/reposition options.

krp312 avatar Oct 26 '22 15:10 krp312

Thanks for reporting. Nothing has changed Rectangle side that would affect this, and things are going smoothly for me with those versions. Perhaps the macOS accessibility (window) API was affected by something else on your Mac? Did you try restarting your Mac?

rxhanson avatar Oct 26 '22 15:10 rxhanson

Thanks for the quick reply! Yeah I've tried a restart.

I've observed the slow behavior after installing Steam. I removed it, but that didn't help. If I figure out what's wrong, I will follow up.

krp312 avatar Oct 26 '22 20:10 krp312

@rxhanson, I just upgraded to macOS 13. I've noticed that Rectangle is faster but there is still about a 2 second delay for resizing/repositioning. I would like to try debugging this before taking more drastic actions, but I'm not sure where to start. Could you point me in the right direction?

krp312 avatar Oct 27 '22 16:10 krp312

Sure, if you get things fired up in Xcode, you can just throw a breakpoint in WindowManager in the execute function and walk through everything to see where something might get hung up.

My hunch is that this is being caused by something outside of Rectangle. After all, Rectangle is literally just making window size/position calculations and telling macOS's accessibility API to move/resize a window.

rxhanson avatar Oct 27 '22 16:10 rxhanson

I hear ya, I'm on the same page — this is probably a problem unique to my computer. I was hoping to get started on debugging from the macOS side (the accessibility API). Any thoughts on how I can get started with that? If not, it's ok.

krp312 avatar Oct 27 '22 19:10 krp312

You could try removing all the apps from the Privacy & Security -> Accessibility section in System Prefs, and see if only having Rectangle shows any differences. If it does, try adding back in everything else one by one and see if you can figure out what caused it.

rxhanson avatar Oct 28 '22 20:10 rxhanson

I've also started to experience this in the past couple of weeks but only with Chrome - the number of tabs open doesn't seem to affect this.

I tried removing all the apps listed in Privacy & Security -> Accessibility (only had one other) and didn't see any improvement.

KiwiJason avatar Nov 02 '22 16:11 KiwiJason

@KiwiJason That's a bug Chrome side, there's a workaround I built in, see the end of the issue: https://github.com/rxhanson/Rectangle/issues/912

rxhanson avatar Nov 02 '22 16:11 rxhanson

I missed that. Thanks! That fixed it for me.

KiwiJason avatar Nov 03 '22 01:11 KiwiJason

@rxhanson I'm thrilled to report that Rectangle is back to normal after updating to 0.63 (69). Curious, any idea what might have fixed it? Should I close this thread?

krp312 avatar Nov 25 '22 20:11 krp312

@krp312 Thanks for following up! The latest changes in 0.63 were specific to Ventura. Multiple parts of the code outside of Ventura specific stuff was changed, but not in ways that would have directly fixed your issue. Unfortunately, in my experience, that means that you might have a scenario where there might be something else affecting the window operations, and that carries the potential that it could be intermittent. Hopefully that's not the case and it's somehow fixed. I'm going to close this just for housekeeping, and we can reopen it if you hit it again.

rxhanson avatar Nov 27 '22 00:11 rxhanson