Move and Resize Windows Works Sporadically, One Step at a Time

I've had the same issue in the past, multiple times, randomly appeared.

I've had issues with resizing MS Word to half screen with KM. I switched to BetterTouchTool for this purpose, which works more reliably. (It's great to have alternative apps.)

Also, sometimes, as I move the mouse, the window changes its size (without pressing any keys). I have set ⌘⌥⌃+Mouse Move to resize window in BetterTouchTool. But I was not pressing any modifier keys. Maybe this is an issue with BTT and not with KM. It also happens randomly.

Thanks for the write up. I'll follow those steps over time.

I did reinstall catalina from recovery, and lots of other maintenance. The problem persists (and lots of others, but things seem a little better overall).

Regarding the window resizing, I've been documenting more and more quick fixes, hoping they might give some clues.

  • restarting KM engine
  • restarting whatever app has the problem
  • switching clamshell mode. for example if the laptop is open (mirrored to external) and i close it, the problem temporarily goes away.

Thanks
If I cant find a fix, I'll migrate a lot of this to BTT too I guess. It's a shame though, I was hoping to retire BTT, it's been buggy for me. Specifically, when I copy and paste triggers and actions, it silently deletes some of them!

I've also had issues like you describe, where BTT interferes in window movement without me pressing the modifiers.

I have the same issue with BTT so I only use it for a few specific trackpad gesture related things I can’t mimic with KM.

@cdthomer
I posted about it recently on the BTT forum, because I think I found a fix, or at least a clue.

Apparently it's fixed? I don't know, my subscription just expired.

Hey @james8231 I'm having the exact same problem and it's driving me insane.

I have some complex window management macros that set up my desktop by moving 4+ apps sometimes and having to hit the key trigger multiple times is beyond annoying…especially because I sometimes move between these different window states.

Have you had any progress in figuring out what the root problem might be?

I still don't have a clue what the issue is. It still happens on my wife's MacBook which I use sporadically, but it's not present on my iMac which is what I use on a daily basis so I don't worry about it.

I did however make some adjustments to my critical positioning actions to ensure they are positioned appropriately. Basically I placed the manipulate a window actions inside a repeat action, and use a global variable to set that number. This way I can make all of those actions repeat as many times as necessary by just changing the contents of one variable. It's a band-aid, but it's an effective band-aid. See the screenshots for more info.

Screenshots of repeat action and global variable (click to expand/collapse)


I still have the same problem. I paid for Moom, it works 100%, and have been removing all window management actions from my KM macros

Dang that's a real bummer. Unfortunately Moom doesn't work for my use case, so guess I'm stuck for now.

I've been fighting this too.

Thanks for that tip. I installed Moom and it's working great. I haven't noticed any instances of needing to hit the keystroke multiple times, and the window movements seem faster and more instantaneous. Totally worth the 10 bucks.

Are you sure Moom won't work for you? You can define window positions to be activated by a keystroke, and then you can trigger those using a Type a Keystroke action in KM. The keystroke could be some obscure complicated key combination that you would never hit manually.

Moom also has the ability to save complete window snapshots for an app. Those can be triggered by a keystroke, a menu or via AppleScript.

Unfortunately no.

My use case was that I would have a single keyboard shortcut that would place windows for 3, sometimes 4, and 5 different apps at once. And sometimes the same keyboard shortcut would change a window's position or size depending on my monitor configuration. So, Moom is just too limited for my use case.

Not a Moom user, but I know it has some AppleScript support. Might you be able to eg create a KM macro that:

  • switched to app1
  • triggered app1's saved windows layout in Moom
  • switched to app2
  • triggered app2's saved windows...
  • etc

It seems as though the saved snapshots executed via AppleScript would handle this part.

This might be the tricky part. If you can detect the monitor layout in AppleScript, then you could branch the AppleScript based on this. I don't use different monitor configs, so I don't know that much about it. But there's a third party app called Display Menu that has AppleScript support. It can list monitors connected and their resolutions, but that won't help if by configuration you mean monitor positioning relative to each other.

WOW! I thought i was crazy because I was having this issue a few times a week but never with any consistency so I ended up moving to Moom a few months ago but I did put together a solution when using KM to just re-run the resize action with a .5 second break between that was able to solve the inconsistently.

Also since I like KM Pallets I now just have it send the keystroke commands to via AppleScript that I have mapped in Moom


I understand why you are placing the Moom keyboard shortcuts in KBM so as to be able to use a conflict palette (an idea I will steal), but I don't understand why you are Applescripting the keystrokes to trigger Moom events instead of just using the native KBM "Type a keystroke" action, which would avoid the need to look up key codes, etc.

1 Like

Well mostly because.. I didn't think of that.

I think I may have tried that originally as it is the most obvious answer and perhaps it wasn't working properly or it was delayed. Going to experiment right now.

For your inspiration here is my "Move Windows" Macro group that I trigger with CON+W for the palette

That is indeed inspiring. I may graduate from misdemeanor stealing to grand theft larceny. Thanks.

1 Like

Resurrecting this thread because this bug appeared on my iMac yesterday. However, I reinstalled macOS from Recovery Mode (like I posted about in post #13) and it went away.

So if anybody is still experiencing this problem, a fresh os install might help, and it’s very simple to do. Below is the link for Apple’s page on how to do it. ↓

How to reinstall macOS - Apple Support

1 Like

I also have this problem. Current solution is to repeat the move and resize for 3x with 0.25s delay. But it can still fail sometimes and sometimes it changes the size of the wrong window (because of the repeat delay)

I wish it just moved the window without animation and to the correct size.

There must be a problem with KM if the other apps work.

It's an OS public API problem and/or feature, depending on what's happening. Other apps may avoid it because they use different methods of interacting with the OS, like private APIs, or do their own "keep trying until the window is in the right place" routine.

One reason you might be seeing this is that the public APIs don't like to resize a window so that parts go off-screen -- it'll stop the resize at the screen edge. If that's the issue then split your action into two and do the move first, then the resize.

Or you can make your own sub-routine to do the "keep trying" method -- this one will have up to 5 tries to position the front window of the frontmost app to the rectangle passed as its parameter:

SUB - Window Move and Resize.kmmacros (3.5 KB)

Image

...and you'd call it with

image

...or similar

1 Like