rxhanson / Rectangle

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

Very slow to perform window resizing or repositioning #963

Closed krp312 closed 1 year ago

krp312 commented 1 year ago

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 commented 1 year ago

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

rxhanson commented 1 year ago

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?

krp312 commented 1 year ago

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 commented 1 year ago

@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?

rxhanson commented 1 year ago

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.

krp312 commented 1 year ago

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.

rxhanson commented 1 year ago

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.

KiwiJason commented 1 year ago

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.

rxhanson commented 1 year ago

@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

KiwiJason commented 1 year ago

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

krp312 commented 1 year ago

@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?

rxhanson commented 1 year ago

@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.