Let's look at SessionStore.js:
Code: Select all
// XUL Window properties to (re)store
// Restored in restoreDimensions()
const WINDOW_ATTRIBUTES = ["width", "height", "screenX", "screenY", "sizemode"];
The screenX and screenY coordinates that are being stored are apparently relative coordinates, not absolute coordinates.
This causes problems on virtual desktops (e.g. FVWM and other sophisticated window managers) where the virtual screen size can be larger than the physical screen.
As only relative, but not absolute window coordinates are stored in the sessionstore.js, screenX and screenY coordinates may have negative values.
Actually this is a regression that got undetected because of a bugfix that just clipped the wrong values to fix a bug that was caused by Flash plugin crashing in fullscreen mode.
(See here: Bug 714803, https://bugzilla.mozilla.or ... ?id=714803, "fixed" in Bug 864107,https://bugzilla.mozilla.org ... ?id=864107)
I want to correct this to make Firefox place the windows correctly when it restores a session.
So I am struggling how to find out some things, mainly
1. Where are the actual window coordinates being derived from?
I expected to find some inquiries to X Window regarding _NET_DESKTOP_GEOMETRY, _NET_NUMBER_OF_DESKTOPS, _NET_DESKTOP_VIEWPORT, _NET_CURRENT_DESKTOP and _NET_WORKAREA either in the javascript stuff or in the C code (like in nsGlobalWindow.cpp for example). (Run xprop -display $DISPLAY -root to see what I mean)
Did not find anything such in the Firefox code yet.
In which function/file does Firefox obtain the actual information from X window system?
2. How could/should I modify/correct the session data (e.g. sessionX and sessionY) so that it gets written into sessionstore.js instead of the original wrong data?
3. could I simply add a member "desktopNr" to WINDOW_ATTRIBUTES and use it to store the desktop id that a particular window is on, too? Or would this break other things?