rxhanson / Rectangle

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

LibreOffice stops responding after pressing "Maximize" shortcut #933

Closed nikwen closed 1 year ago

nikwen commented 2 years ago

macOS version: 12.6 Rectangle version: 0.59 LibreOffice version: 7.4.1.2 Logs if applicable (In Rectangle menu, hold option, "View Logging..."):

How to reproduce:

What should happen:

What happens:

This is not reproducible 100% of the time but it occurs often enough for it to be annoying. I'd guess it happens every 3rd or 4th time I use LibreOffice during daily use. I have never seen this behavior with other applications than LibreOffice.

Video showing the issue:

https://user-images.githubusercontent.com/3309657/193144347-4c62c047-830a-41a8-8291-8ba3de4f1d88.mp4

rxhanson commented 2 years ago

Thanks for reporting. If you don't mind, it would be helpful up front to get the logs for the scenario where it fails to resize properly, in case there is anything that can be done Rectangle side for it (In Rectangle menu, hold option, "View Logging...")

  1. Not resizing properly is nearly always an issue with the application being resized, and it is highly unlikely that it makes sense to adjust Rectangle in this scenario. The recommended path forward for this is to file an issue with the application (LibreOffice).
  2. Certain apps, typically cross platform ones exhibit this issue. If you disable snap windows by dragging, then you won't see this issue. I'll add it to an internal list of apps that have this issue, where ignoring the app will also ignore the drag to snap behavior for it. This will be in the next release.
nikwen commented 2 years ago

Thank you for your reply, @rxhanson!

Below are Rectangle logs from a time when LibreOffice stopped responding. I resized LibreOffice a couple of times and moved it between monitors and at the end of the log file it stopped responding.

An interesting observation: when LibreOffice stops responding and doesn't resize, Rectangle (including the logging window) also stops responding until I force quit LibreOffice.

Thanks for the tip to disable snap windows by dragging. I've disabled that now and will let you know if I run into the issue again.

2022-09-30T10:31:49+02:00: Unable to obtain window id
2022-09-30T10:31:50+02:00: Unable to obtain window id
2022-09-30T10:31:55+02:00: Unable to obtain accessibility element
2022-09-30T10:31:55+02:00: Failed to find frontmost window.
2022-09-30T10:32:02+02:00: AX sizing proposed: (1920.0, 1055.0), result: (1676.0, 875.0)
2022-09-30T10:32:02+02:00: AX position proposed: (727.0, -1055.0), result: (727.0, -1055.0)
2022-09-30T10:32:02+02:00: AX sizing proposed: (1920.0, 1055.0), result: (1920.0, 1055.0)
2022-09-30T10:32:02+02:00: maximize | display: (727.0, 900.0, 1920.0, 1055.0), calculatedRect: (727.0, -1055.0, 1920.0, 1055.0), resultRect: (727.0, -1055.0, 1920.0, 1055.0), srcScreen: Dell U2414H (1), destScreen: Dell U2414H (1), resultScreen: Dell U2414H (1)
2022-09-30T10:32:03+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:03+02:00: AX position proposed: (971.0, -875.0), result: (971.0, -875.0)
2022-09-30T10:32:03+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:05+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:05+02:00: AX position proposed: (0.0, 25.0), result: (0.0, 25.0)
2022-09-30T10:32:05+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:05+02:00: previousDisplay | display: (0.0, 0.0, 1440.0, 875.0), calculatedRect: (0.0, 25.0, 1440.0, 875.0), resultRect: (0.0, 25.0, 1440.0, 875.0), srcScreen: Dell U2414H (1), destScreen: Built-in Retina Display, resultScreen: Built-in Retina Display
2022-09-30T10:32:05+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:05+02:00: AX position proposed: (-953.0, -965.0), result: (-953.0, -965.0)
2022-09-30T10:32:05+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:05+02:00: previousDisplay | display: (-1193.0, 900.0, 1920.0, 1055.0), calculatedRect: (-953.0, -965.0, 1440.0, 875.0), resultRect: (-953.0, -965.0, 1440.0, 875.0), srcScreen: Built-in Retina Display, destScreen: Dell U2414H (2), resultScreen: Dell U2414H (2)
2022-09-30T10:32:07+02:00: AX sizing proposed: (1920.0, 1055.0), result: (1680.0, 965.0)
2022-09-30T10:32:07+02:00: AX position proposed: (-1193.0, -1055.0), result: (-1193.0, -1055.0)
2022-09-30T10:32:07+02:00: AX sizing proposed: (1920.0, 1055.0), result: (1920.0, 1055.0)
2022-09-30T10:32:07+02:00: maximize | display: (-1193.0, 900.0, 1920.0, 1055.0), calculatedRect: (-1193.0, -1055.0, 1920.0, 1055.0), resultRect: (-1193.0, -1055.0, 1920.0, 1055.0), srcScreen: Dell U2414H (2), destScreen: Dell U2414H (2), resultScreen: Dell U2414H (2)
2022-09-30T10:32:08+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:08+02:00: AX position proposed: (971.0, -875.0), result: (971.0, -875.0)
2022-09-30T10:32:08+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:09+02:00: AX sizing proposed: (1920.0, 1055.0), result: (1676.0, 875.0)
2022-09-30T10:32:09+02:00: AX position proposed: (727.0, -1055.0), result: (727.0, -1055.0)
2022-09-30T10:32:09+02:00: AX sizing proposed: (1920.0, 1055.0), result: (1920.0, 1055.0)
2022-09-30T10:32:09+02:00: maximize | display: (727.0, 900.0, 1920.0, 1055.0), calculatedRect: (727.0, -1055.0, 1920.0, 1055.0), resultRect: (727.0, -1055.0, 1920.0, 1055.0), srcScreen: Dell U2414H (1), destScreen: Dell U2414H (1), resultScreen: Dell U2414H (1)
2022-09-30T10:32:10+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:10+02:00: AX position proposed: (971.0, -875.0), result: (971.0, -875.0)
2022-09-30T10:32:10+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:11+02:00: Unable to obtain accessibility element
2022-09-30T10:32:16+02:00: Unable to obtain accessibility element
2022-09-30T10:32:16+02:00: Failed to find frontmost window.
2022-09-30T10:32:19+02:00: AX sizing proposed: (1920.0, 1055.0), result: (1676.0, 875.0)
2022-09-30T10:32:19+02:00: AX position proposed: (727.0, -1055.0), result: (727.0, -1055.0)
2022-09-30T10:32:19+02:00: AX sizing proposed: (1920.0, 1055.0), result: (1920.0, 1055.0)
2022-09-30T10:32:19+02:00: maximize | display: (727.0, 900.0, 1920.0, 1055.0), calculatedRect: (727.0, -1055.0, 1920.0, 1055.0), resultRect: (727.0, -1055.0, 1920.0, 1055.0), srcScreen: Dell U2414H (1), destScreen: Dell U2414H (1), resultScreen: Dell U2414H (1)
2022-09-30T10:32:20+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:20+02:00: AX position proposed: (971.0, -875.0), result: (971.0, -875.0)
2022-09-30T10:32:20+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:21+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:21+02:00: AX position proposed: (0.0, 25.0), result: (0.0, 25.0)
2022-09-30T10:32:21+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:21+02:00: previousDisplay | display: (0.0, 0.0, 1440.0, 875.0), calculatedRect: (0.0, 25.0, 1440.0, 875.0), resultRect: (0.0, 25.0, 1440.0, 875.0), srcScreen: Dell U2414H (1), destScreen: Built-in Retina Display, resultScreen: Built-in Retina Display
2022-09-30T10:32:21+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:21+02:00: AX position proposed: (-953.0, -965.0), result: (-953.0, -965.0)
2022-09-30T10:32:21+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:21+02:00: previousDisplay | display: (-1193.0, 900.0, 1920.0, 1055.0), calculatedRect: (-953.0, -965.0, 1440.0, 875.0), resultRect: (-953.0, -965.0, 1440.0, 875.0), srcScreen: Built-in Retina Display, destScreen: Dell U2414H (2), resultScreen: Dell U2414H (2)
2022-09-30T10:32:22+02:00: AX sizing proposed: (1920.0, 1055.0), result: (1680.0, 965.0)
2022-09-30T10:32:22+02:00: AX position proposed: (-1193.0, -1055.0), result: (-1193.0, -1055.0)
2022-09-30T10:32:22+02:00: AX sizing proposed: (1920.0, 1055.0), result: (1920.0, 1055.0)
2022-09-30T10:32:22+02:00: maximize | display: (-1193.0, 900.0, 1920.0, 1055.0), calculatedRect: (-1193.0, -1055.0, 1920.0, 1055.0), resultRect: (-1193.0, -1055.0, 1920.0, 1055.0), srcScreen: Dell U2414H (2), destScreen: Dell U2414H (2), resultScreen: Dell U2414H (2)
2022-09-30T10:32:23+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:23+02:00: AX position proposed: (0.0, 25.0), result: (0.0, 25.0)
2022-09-30T10:32:23+02:00: AX sizing proposed: (1440.0, 875.0), result: (1440.0, 875.0)
2022-09-30T10:32:23+02:00: nextDisplay | display: (0.0, 0.0, 1440.0, 875.0), calculatedRect: (0.0, 25.0, 1440.0, 875.0), resultRect: (0.0, 25.0, 1440.0, 875.0), srcScreen: Dell U2414H (2), destScreen: Built-in Retina Display, resultScreen: Built-in Retina Display
2022-09-30T10:32:23+02:00: AX sizing proposed: (1920.0, 1055.0), result: (1440.0, 875.0)
2022-09-30T10:32:23+02:00: AX position proposed: (727.0, -1055.0), result: (727.0, -1055.0)
2022-09-30T10:32:35+02:00: AX sizing proposed: (1920.0, 1055.0), result: N/A
2022-09-30T10:32:54+02:00: AX sizing proposed: (0.0, 0.0), result: N/A
2022-09-30T10:32:54+02:00: AX position proposed: (2647.0, 0.0), result: N/A
2022-09-30T10:32:54+02:00: AX sizing proposed: (0.0, 0.0), result: N/A
2022-09-30T10:32:54+02:00: nextDisplay | display: (727.0, 900.0, 1920.0, 1055.0), calculatedRect: (727.0, -1055.0, 1920.0, 1055.0), resultRect: (inf, inf, 0.0, 0.0), srcScreen: Built-in Retina Display, destScreen: Dell U2414H (1), resultScreen: Dell U2414H (2)
2022-09-30T10:32:54+02:00: Unable to obtain accessibility element
2022-09-30T10:32:54+02:00: Failed to find frontmost window.
2022-09-30T10:32:54+02:00: Unable to obtain accessibility element
2022-09-30T10:32:54+02:00: Failed to find frontmost window.
2022-09-30T10:32:54+02:00: Unable to obtain accessibility element
2022-09-30T10:32:54+02:00: AX sizing proposed: (260.0, 250.0), result: (260.0, 250.0)
2022-09-30T10:32:54+02:00: AX position proposed: (1557.0, -652.0), result: (1557.0, -652.0)
2022-09-30T10:32:54+02:00: AX sizing proposed: (260.0, 250.0), result: (260.0, 250.0)
2022-09-30T10:32:54+02:00: maximize | display: (727.0, 900.0, 1920.0, 1055.0), calculatedRect: (727.0, -1055.0, 1920.0, 1055.0), resultRect: (1557.0, -652.0, 260.0, 250.0), srcScreen: Dell U2414H (1), destScreen: Dell U2414H (1), resultScreen: Dell U2414H (1)
nikwen commented 2 years ago

If you disable snap windows by dragging, then you won't see this issue.

After your last comment, I disabled "snap windows by dragging" but the issue reappeared again today. Seems like the setting does not influence whether this bug occurs.

rxhanson commented 2 years ago

Hmm. Disabling snap windows by dragging will turn off Rectangle's "listening" to mouse down/up/drag events. When that's disabled, the only thing that Rectangle is doing is calling the Accessibility API to move/resize the frontmost window. The last thing you can do is ignore LibreOffice in the Rectangle menu bar menu. If that doesn't fix anything, then we are looking at probably just an incompatibility between the two apps (or rather, LibreOffice and any window manager).

nikwen commented 2 years ago

Here's an observation I made coupled with an idea:

When Rectangle maximizes the LibreOffice window, it consists of two steps:

  1. Enlarge the window so that the bottom-right corner of the application window matches the bottom-right corner of the screen.
  2. Enlarge the window again so that the upper-left corner of the application window matches the upper-left corner of the screen.

As you can see in the video above, LibreOffice freezes between the two steps. Maybe LibreOffice cannot deal with two consecutive resize operations that happen in such rapid succession?

Maybe the following would work:

  1. Move the LibreOffice application window into the top-left corner of the screen (without any resizing).
  2. Enlarge the window so that the bottom-right corner of the application window matches the bottom-right corner of the screen.

I think this would very well be worth a try. What do you think?

rxhanson commented 2 years ago

Thanks for the additional info. It'll be a while before I can try anything out for this one, but feel free to load up Rectangle from source and see if you can figure anything out. Rectangle will set size, set position, then set size again, and you can step through it in setRectOf in AccessibilityElement.

nikwen commented 2 years ago

Thanks for your reply, @rxhanson! If you can get Rectangle to maximize LibreOffice without any freezes, I'll happily buy 3 copies of Rectangle Pro. One for me, two as gifts for friends. The offer stands for 2 months. :)

Neoconair commented 1 year ago

+1 for me on this issue. For me, the problem only seems to occur with drag & snap, not with the keyboard shortcuts. But it's not limited to 'maximise'

nikwen commented 1 year ago

LibreOffice 7.4.4 contains a patch that is supposed fix this issue. I upgraded 5 minutes ago and have not yet had this issue again. Thus, I'll close the issue for now. If it reappears, I'll reopen it.

Thank you for your help in investigating this, @rxhanson!

kolydart commented 1 year ago

Same happens with me. It happens with any type of LibreOffice document (writer, calc, etc.). The difference is that I don't see the right bottom part of the window move to the edge. It hangs immediately. I have also tried:

nikwen commented 1 year ago

This issue has been gone for me so far on v7.4.4.

kolydart commented 1 year ago

I can also confirm that after upgrading to v7.4.4, a week ago, I did not have a single freeze since.

kolydart commented 1 year ago

After almost a month of no-freezing no-headache period, I updated today rectangle to version 0.66. I've been having frequent freezes since. I am downgrading rectangle to 0.65 hoping I can isolate the issue.

nikwen commented 1 year ago

After almost a month of no-freezing no-headache period, I updated today rectangle to version 0.66. I've been having frequent freezes since. I am downgrading rectangle to 0.65 hoping I can isolate the issue.

Just LO or in other software, too? If the latter, you might want to create a new issue.

kolydart commented 1 year ago

Only in LO. The only clue I have is the time proximity with updating rectangle for which I knew there was a problem in the past. Most likely it has nothing to do with rectangle.

nikwen commented 1 year ago

That's weird! Did you install a new LO version, too? (I'm on LO 7.4.4.2 and Rectangle 0.64 myself.)

kolydart commented 1 year ago

I have updated LO to 7.4.5.1. I cant recall when I updated it. I have to look further.

kolydart commented 1 year ago

After a few weeks of usage I can confirm that my LO crashes are irrelevant to both Rectangle, and the maximize button.