Bug 5733 - Track window position when monitors change, restore position (if not dirtied) when same monitors are restored.
Status: ASSIGNED
Alias: None
Product: Openbox
Classification: Unclassified
Component: general
Version: 3.5.0
Hardware: PC Linux
: P2 enhancement
Assignee: Dana Jansens
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2012-08-22 21:01 EDT by Adam Katz
Modified: 2021-01-11 14:02:48 EST
1 user (show)

See Also:



Description Adam Katz 2012-08-22 21:01:11 EDT
Steps to reproduce:

0. You need a dual-head display.  Mine is a laptop display beside a monitor.
1. Place windows on both heads.
2. Remove one of the heads (e.g. `xrandr --output VGA-0 --off`)
3. Add the head back (e.g. `xrandr --output VGA-0 --right-of LVDS-0`)

Expected results:

On step 2, windows should be shunted to the remaining monitor (windows that fit wholly on what is left of the screen should be wholly on it, larger windows should at have at least some portion of them on the screen).  Metacity (v2.34) and xfwm4 (v4.8.3 but not v4.10.0) do this correctly.

On step 3, windows should be reverted to their original positions.  Metacity and xfwm 4.10.0 do this correctly, xfwm4 v4.8.3 does not.

Actual results:

Some windows are moved slightly on step 2, making them a little more accessible.  This is what xfwm4 v4.10 does, so perhaps this was the intended functionality.  This would be tolerable if it weren't for the fact that step 3 does nothing to the window placement.


I haven't tested it, but I suspect this bug also exists in the event you lower the resolution of your single-head system (e.g. for a projector) and then grow it back up to full size.


I am using the debian package openbox 3.5.0-4 (see http://packages.qa.debian.org/o/openbox.html for notes on the four changes made to the package).  Though it shouldn't matter, I am using nVidia TwinView for my two heads.
Comment 1 Adam Katz 2012-09-17 20:39:17 EDT
Is there something I can do to make this easier to fix?  More information, better example, dumps, etc?

I am eager to help because my workaround is to use xfwm4, which I consider quite suboptimal.
Comment 2 Adam Katz 2021-01-11 13:57:39 EST
Confirmed to still be an issue with Debian's openbox 3.6.1-9 package.

I may not have phrased it so well 8y ago and this is now easier to reproduce (just play with plugs rather than commands):

1. Connect a monitor
2. Put a window entirely into the new screen's view
3. Disconnect the monitor. That window moves to remain visible
4. Connect the monitor again. Where is that window?

Expected result: It is back in its position from step 2
Actual result:   It remains in the position it had in step 3

This makes it very annoying to take my laptop from my desk to another room since I have to rearrange a hundred windows when reconnecting my external monitor.
Comment 3 Dana Jansens 2021-01-11 14:02:01 EST
Thanks for clarifying. It would make sense but requires some additional state tracking of the old positions whenever a monitor change/desktop size change occurs. I think it's a good idea though.