Move & Resize Window Bug?

Using KM 9.0.4 on macOS 10.15.2.

The following action should move the current window to the monitor where the mouse is currently placed, resize it to 75% of the screen size, and move it so it is centered on the screen (in this case, located 12.5% of the screen size from the top left corner).

This works fine most of the time and the result looks like this:

BUT...

If the mouse is on the internal screen of my Macbook Pro AND it is positioned at the bottom of the screen, causing the dock to appear (it is normally hidden), the action breaks. The window becomes smaller than intended and is placed in the upper left corner instead of at the 12.5% point. (The window in the example is actually larger than if I do it with, for example, Firefox. KM appears to have a larger minimum window size.

I thought I might be able to do a work around by adding an action that simply centers the window after the resize action. While that gets me a centered window, it still remains much smaller than the intended 75% of visible screen size.

Ooh, I might know this one. I have a hunch that your situation would be resolved by replacing SCREENVISIBLE() with SCREEN(). Screenvisible refers to the area of the screen excluding the dock and the menubar. I wonder if having the mouse in the dock area breaks screenvisible because the mouse is not on any part of the screen area in question. Therefore it defaults to coordinate 0,0. On second thought I'm not sure why the size is fine, but the location isn't. Anyway, try SCREEN() and see if it fixes it. For what it's worth, I'd try this out on my device but I honestly can't be bothered making my own macro for it. If you upload the macro you're using in posts asking for help it lets people tweak it themselves and see if it works before providing an answer :slight_smile:

1 Like

Same thing happens using SCREEN.

Worth a shot. Thanks for the suggestion.

1 Like

If your mouse is at the very bottom or right edge of the screen, it can appear to be off the screen, in which case it is on no screen, and you get 0 results from the SCREEN functions.

I probably need to allow a slight extra amount for the Mouse screen location, although it is complicated by the fact that there can be multiple adjacent screens in any direction.

Ah ha. That makes perfect sense. Thanks for the clarification.

1 Like