calandoa/movescreen

Add "previous" and "next" option

Closed this issue · 8 comments

I would prefer only on shortcut which I can assign to movescreen.py next which will just moves me through the list of monitors.

Also moving windows left/right/up/down is sometimes buggy, depending on the monitor configuration (how monitors are virtually placed in space). Below is a picture of a monitor configuration where moving a window to the left results in strange behavior. Window moves on the first monitor. The monitors don't only touch at the corner (then moving doesn't work at all), but overlap a few pixels.
screenshot_2018-10-09_17-55-02

With a "next" option moving a window or mouse cursor to the next window should be much less buggy.

I added next and prev arguments, to cycle through screens in xrandr order.

With only two screens, both arguments should behave the same .

Instead of keeping the same global X (up/down) or Y position (left/right), it modifies both global coordinates so the ones relatives to the top left corner of the current screen remain the same on the next screen.

Thanks!
I have two monitors: 2560x1080 and 1980x1080 (rotated vertically).

I am using the next option now. Sometimes however windows are just moved on the bigger monitor to the left on the first "next" press. A second "next" press they move to the other monitor. Maybe I can debug this issue somehow (something like a debug mode in the script which writes monitor, window and mouse coordinates to a log file) and post the results here?

Also when I move some windows from monitor 1 to monitor 2 via "next" (also probably the same via "left" and "right"), it positions the windows not optimally. Sometimes only a small part of the window is visible on the other monitor, although there is enough space to show the entire window if it were at the correct position.
What is you procedure on positioning windows after being moved to a new monitor?
If the monitors were identical in size or close in aspect ratio it would make sense to somewhat preserve the old window position.
However in my case one monitor is rotated vertically, so the aspect ration is the opposite. Preserving window positions in this case would be problematic in some cases. Maybe the script should just place them in the middle of the new monitor if the monitors are very different in size and aspect ratio?

next/prev will always change monitors, so this is expected.

left/right will move X pos of the width of the monitor
up/down will move Y pos of the height of the monitor
next/prev will keep the same X/Y relative to the top left corner of the monitor

Using other rules is not a good idea as moving a window forth then back should replace it at the same position. You can try to maximize it before moving it, then un-maximize it.

I am also thinking of implementing a new argument "fit"

next/prev will always change monitors, so this is expected.

What are you refering to? I described two issues:

  1. where on the first "next" press, the window does not move to the next window but moves withing the current window. This seems like a bug. Maybe I explained it not well.
  2. on pressing "next" the window moves to the correct monitor but has a very weird position (where for example only a small part of its lower left corner is visible).

I am also thinking of implementing a new argument "fit"

Please consider something like "centerfit". Place in the center of the new monitor and scale down - but only if it does not fit.

Ok, I did not understood these issues. But I cannot reproduce them either.

You can try to print at then end of the script: dir, geo, scr, npos, sidx, nscr with
print "dir:", dir
...

BTW I added fit

Any chance to print more debug info?