Move and resize window on a two displays setup in a “tipped-over” T arrangement

Hi there,

I have two displays arranged in something I would call a “tipped-over” T arrangement:

If I have a window on the display on the right, that is wider than the display on the left like this:

And I wish to have this window moved to the left display and being maximized there I should in theory do it with this action in a KM macro:

Keyboard Maestro Problem 3

But unfortunately the result looks like this:

Only when I split the resizing and moving and then repeat the resizing like this:

Keyboard Maestro Problem 4

I get the desired result:

My theory is that the “Move and Resize Front Window” action indeed moves the window first and resizes it second and thereby the Front Window got in a limbo state where got somehow stuck between both displays and therefore can’t be resized.

Is there another way instead of splitting “Move and Resize Front Window” action in three parts/steps?

Big THX, Yves

Yes, it does seem to be a "two part" operation, and the OS (not the KM action) can throw a wobbly when the "intermediate" window's bounds don't fit the display area. Easiest way round that in this case is a two-step move and resize, setting the width to that of your vertical display before moving and completing the resize:

image

Depending on your tolerance for flashing windows, you may prefer to keep the window at the same position and height and just change the width in the initial action (which will work because if it fits on display 2 at the start it will still fit when the width is changed to suit display 1, as display 1 is the narrower).

Okay, I really should not be sharing this because it's unfinished and I've literally ripped it out of a larger window management framework that I'm trying to complete. And I don't even have the time right now to test that I've not broken it by doing that.

So no promises. But it can't do anything bad, and it is a very useful subroutine. (I promise I'll release something more polished and featurific once I catch up with stuff)

It's mostly self documented. Essentially, call the subroutine providing some or all of the arguments. Only the destination display is mandatory. Called like that, it will move the current front window to that display and proportionally scale the window. (I have the same portrait and landscape setup) Or you can provide left, top, width and height as absolute values. Or as percentages. (I like % because I change my resolutions around)

Caveat emptor!
Place window.kmmacros (64.1 KB)

Whoops, sorry I also uploaded it "enabled". Don't worry, it's a subroutine so nothing will happen until you call it.

Thanks for all the suggestions so far.

@Nige_S I implemented your suggestion because a) yours was the first and b) it was quickly to implement. Thank you for your quick feedback.

@devoy Also thank you for sharing this extensive library of macros. I will dive deeper into them once I find the time. So far these macros look very advanced and it will take some crunching to digest and adapt them.