SessionStore.jsm questions

User Help for Mozilla Firefox
Post Reply
Snurg
Posts: 4
Joined: August 23rd, 2016, 11:01 am

SessionStore.jsm questions

Post by Snurg »

I was investigating a SessionStore bug when I found out that there are a few shortcomings in the session/restore implementation.
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"];
This is the list of attributes preserved.
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?
User avatar
LIMPET235
Moderator
Posts: 39961
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Re: SessionStore.jsm questions

Post by LIMPET235 »

Moving to Firefox Support...
[Ancient Amateur Astronomer.]
Win-10-H/64 bit/500G SSD/16 Gig Ram/450Watt PSU/350WattUPS/Firefox-115.0.2/T-bird-115.3.2./SnagIt-v10.0.1/MWP-7.12.125.

(Always choose the "Custom" Install.)
Post Reply