Some windows' actions don't work properly

My main app to manipulate windows in Mac is Moom. It works beautifully, and it's my favorite when it comes to manipulating windows. But I wanted to give KM a chance, that way I would have 2 in 1. So I started to use KM instead of Moom for more than 24 hours and noticed an issue with the default bottom left and right corners. They keep the previous height if it's longer than half the height of the screen but if the previous height is smaller than half the height of the screen then it works fine.

This is the default setting for one of the bottom corners, specifically the bottom left corner

Default Bottom Left.kmmacros (1.9 KB)

Default Bottom Left

I had to change the height from "SCREENVISIBLE(Main,Height)*50%" to "396"

Bottom Left.kmmacros (2.1 KB)

Bottom Left

Which is not perfect because the dock shrinks and expands and the screen height changes accordingly but "396" is close enough to the half of the height and way better than windows expanding all the way out of the screen.

Is there a way to make bottom quarters work correctly?

Hey Ali,

You may have exposed a bug.

I’ve asked Peter.

-Chris

Thank you, Stone. I’ll keep using KM instead of Moom anyway, I hope this issue gets fixed.

Hey Ali,

According to Peter this is an Apple issue he really can’t work around directly.

BUT – by changing the macro slightly you yourself can overcome the issue.

((SCREENVISIBLE(Main,Height))*50%)-1

Subtracting that one pixel makes all the difference.

-Chris

It might look like it’s working if we keep adjusting the height without expanding the window to test its behavior when we change the value but once that window expands it will keep the height if we resize it again.

Hey Ali,

I’m afraid that what you just said makes no sense to me… :wink:

Perhaps you should demonstrate with a screenshot the precise behavior you’re wanting and how Keyboard Maestro is deviating from that.

-Chris

Sorry about that. English is not my native language. I’ll try my best.

Suppose the shortcut assigned to the bottom left corner is ⌥’ and the fullscreen shortcut is ⌥↑.

When I change the height of the bottom left corner in KM then press it’s shortcut ⌥’ to test the difference, it would look like the changes are working but they’re not. What I must do instead - to test the changes in height - is to hit ⌥↑ in order to expand the window to fullscreen then ⌥’ to see if the height would resize from fullscreen to the desired height instead of passing the dock.

This line acts the same as the rest and passes the dock, unfortunately.

((SCREENVISIBLE(Main,Height))*50%)-1

The issue is that the system window resizing will not allow the window to be resized off the visible screen, and the system is not agreeing with itself as to what constitutes the visible screen.

You may be able to force it to resize by resizing it smaller and then larger.

Hey Ali,

No worries. Even when humans speak the same language they don't always communicate effectively.  :wink:

Perhaps I'm still misunderstanding, but the macro I've posted works correctly every time I make the Dock visible or not visible.

I've tested in the Finder, Safari, the Keyboard Maestro Editor, and several other apps.

Is it failing for you everywhere?

For reference I'm testing with Keyboard Maestro 8.2 on macOS 10.12.6.

-Chris


Bottom Left -- Quarter Screen.kmmacros (4.7 KB)

You may be able to force it to resize by resizing it smaller and then larger.

Yes, I have to make it smaller first then it will work.

This is how it looks like.
It happens every time if the previous window's height is larger than the height of the bottom left corner.

Hey Ali,

Oh, yeah.

If you just can't make the given macro work at all you can test the screen visible height to see if the Dock is open or not and then add a position step to compensate for the problem.

I've done this with AppleScript in the macro below, but you can do the same thing with Keyboard Maestro actions.

-Chris


Keyboard Maestro 8.2 “Window -- Bottom Quarter -- Compensate for Dock Weirdness” Macro

Window -- Bottom Quarter -- Compensate for Dock Weirdness.kmmacros (5.0 KB)

Thank you. Unfortanelty, this one didn’t work.
I’ll stick to my edited macro. It’s wouldn’t be that far from the Dock anyway.

The right edge of the screen also behaves the same way.

Earlier versions of Moom used to behave the same way when certain apps like iTunes in small displays can't be resized, then changed in later versions to keep apps on the screen.

Here is an example. iTunes in MacBook Pro 15" can't be resized to half of the screen. So KM pushes it outside the right edge of the screen.

What it should do instead is to keep the app on the screen even it can't be resized.

The priority is to keep the app on the screen.

I would have to make some change to right screen actions the same way I did to the other ones. It would be close enough.

Hey Ali,

You’re the one whose driving.  :wink:

Keyboard Maestro is not a window manager. It gives you building blocks to manage them yourself, and the “built-in” actions are just templates based on user-changeable calculations.

The behavior you want is something you can arrange yourself.

Resize the window and then test the size. If it’s what it should be then move it – if NOT then change the move-to destination first and then move it.

Besides – there are people who do want to be able to move windows beyond the screen boundary.

-Chris