What I want is not only remember the maximized state of a window, but also the origin normal size of the window.
It means (an example):
A window’s normal size is 820x500.
Set it in maximized state the window size change to 1024x768.
quit and run it again:
the window is set to maximized state.
Set it in normal state, the size of the window will back to 820x500.
No – since Firefox and Mozilla take delight in breaking the ICCCM. You should be complaining to them about it. Essentially you’re under the impression that the window has a normal state of size other than when it were maximized. This just isn’t true with apps such as Firefox and Mozilla who will remember their size no matter what.
That’s why you should get FVWM to ignore PPosition and to use UseUSPosition. This will then allow to use -width and -height attributes of Firefox. Although it really ought to be accepting -geometry strings. It’s just broken, and needs fixing upstream. You could go down the complex scripting route, but it needs redefining as the use of setenvs is appauling. You’ll be polluting the environment for every new instance of Firefox or whatever you happen to run each time. In the scripts you have posted, you don’t have any “UnSetEnv” lines which I strongly suggest you consider using if you are going to go down that horrible route.
I do not like complaining, and I don’t care whether the session manager or the window manager to manager the initial geometry of a window too. My code’s work is to keep a window’s “normal size” if the window is started in fullscreen size – It will still start in fullscreen size, while keeping the normal size before it quit. I am not idea whether the --geometry can do this work.
What I cannot understand is,
Why a window cannot have a normal size while it keep in maximized?
Why a window quit it should loss the information about the normal size?
Why a window whould loss the maximized state when it quit?
Why these information can be kept in gNOME or KDE?
Why a window will be set to Maximized state (but not fullscreen size) if it is quited in gNOME with Maximized state?
FVWM cannot do as I hope, of cause I can extend its function.
I hope 100 Windows with 100*4=400 environment variables won’t be too many to FVWM. Of cause I do not know the strength of FVWM. Luckly, I usually will open up less then 15 windows, and the FVWM seems that can manage these 60 environment variables, and my code works very well until now.
Maybe the environment variables would be passed down to the subsessions started by fvwm in some case, and this may do harm to the subsession. But this have not happened yet.
At last I hope you read my codes carefully before posting a reply,