Re: FVWM: Maximize and window location
Le Mon, 13 May 2013 22:45:01 +0100, Thomas Adam a écrit : > On 13 May 2013 22:41, Dominique Michel > wrote: > > Le Mon, 13 May 2013 21:46:43 +0100, > > Thomas Adam a écrit : > > > >> On Mon, May 13, 2013 at 09:05:41PM +0200, Dominique Michel wrote: > >> > Hi, > >> > > >> > It is several Maximize function in Fvwm-Crystal. When a new > >> > window is opened, a SetEnv made a variable with its window id > >> > and its maximized state. 2 temporary files are also created, one > >> > with the window width, the other with its height. I done this > >> > because I found no other to do what I want and this to survive a > >> > restart. May be it is simpler solution, but I didn't find it if > >> > it exist. > >> > >> Sounds very over-complicated to me. Using a WindowID is bad here, > >> not necessarily because it's only per-window, but for the fact > >> that when FVWM restarts, the inherent use of WindowStyle to set > >> the style of the window means it's lost on a restart. > >> > >> When FVWM restarts, its windows are reparented to the root window, > >> and then reparented when FVWM starts again; in your case, the > >> maximized state is recorded for windows across restarts, but FVWM > >> doesn't record the state of all states across restarts for > >> WindowStyle'd windows. > > > > They are lost anyway when fvwm restarts, it is why a added a > > function to restore them. The id is used only to apply the > > fullscreen styles on the full screened windows. > > Well that's probably half the problem then, > > > When working on fvwm-crystal, I restart quite often and get > > You're doing that wrong. See: > > https://plus.google.com/u/0/100692260234415059882/posts/YqzdH3jeAEg I use FvwmConsole and Xephyr too. I even added a Xephyr menu into the system menu. It look for the xsession files in /etx/X11/Xsessions. But when I am done with some changes, I move them to the svn, re-install fvwm-crystal and do a restart. > > > tired of resizing the windows after a restart. > > Get BugOpts ExplainWindowPlacement and similar in to your logs so I > can see what's happening, I will do that. > or better yet, get a consistent application > which shows your problem, and let me have steps to reproduce it. It will be difficult because it is a random issue that append from time to time. Dominique > > -- Thomas Adam -- "We have the heroes we deserve."
Re: FVWM: Maximize and window location
Le Mon, 13 May 2013 21:46:43 +0100, Thomas Adam a écrit : > On Mon, May 13, 2013 at 09:05:41PM +0200, Dominique Michel wrote: > > Hi, > > > > It is several Maximize function in Fvwm-Crystal. When a new window > > is opened, a SetEnv made a variable with its window id and its > > maximized state. 2 temporary files are also created, one with the > > window width, the other with its height. I done this because I > > found no other to do what I want and this to survive a restart. May > > be it is simpler solution, but I didn't find it if it exist. > > Sounds very over-complicated to me. Using a WindowID is bad here, not > necessarily because it's only per-window, but for the fact that when > FVWM restarts, the inherent use of WindowStyle to set the style of > the window means it's lost on a restart. > > When FVWM restarts, its windows are reparented to the root window, > and then reparented when FVWM starts again; in your case, the > maximized state is recorded for windows across restarts, but FVWM > doesn't record the state of all states across restarts for > WindowStyle'd windows. They are lost anyway when fvwm restarts, it is why a added a function to restore them. The id is used only to apply the fullscreen styles on the full screened windows. > > It seems to me like you're reinventing a session manager here anyway; > something I don't want to pedal as good advice anyway. When working on fvwm-crystal, I restart quite often and get tired of resizing the windows after a restart. > > > Normally, it work just fine and the window is restored to its > > original size and location. But sometime after a restart, only the > > window borders and title style are restored and the window remain > > in its full maximized state. When this append, I can call FulScreen > > several times, the window never return to its original size and > > location. > > Then something about the window when it is recaptured is causing > another style to match this window, most likely. I will try to increase the schedule time for the function that apply the fullscreen styles at restart and see what append. Best, Dominique > > -- Thomas Adam > -- "We have the heroes we deserve."
Re: FVWM: Maximize and window location
On Mon, May 13, 2013 at 09:05:41PM +0200, Dominique Michel wrote: > Hi, > > It is several Maximize function in Fvwm-Crystal. When a new window is > opened, a SetEnv made a variable with its window id and its > maximized state. 2 temporary files are also created, one with the > window width, the other with its height. I done this because I found no > other to do what I want and this to survive a restart. May be it is > simpler solution, but I didn't find it if it exist. Sounds very over-complicated to me. Using a WindowID is bad here, not necessarily because it's only per-window, but for the fact that when FVWM restarts, the inherent use of WindowStyle to set the style of the window means it's lost on a restart. When FVWM restarts, its windows are reparented to the root window, and then reparented when FVWM starts again; in your case, the maximized state is recorded for windows across restarts, but FVWM doesn't record the state of all states across restarts for WindowStyle'd windows. It seems to me like you're reinventing a session manager here anyway; something I don't want to pedal as good advice anyway. > Normally, it work just fine and the window is restored to its original > size and location. But sometime after a restart, only the window > borders and title style are restored and the window remain in its full > maximized state. When this append, I can call FulScreen several times, > the window never return to its original size and location. Then something about the window when it is recaptured is causing another style to match this window, most likely. -- Thomas Adam -- "Deep in my heart I wish I was wrong. But deep in my heart I know I am not." -- Morrissey ("Girl Least Likely To" -- off of Viva Hate.)
FVWM: Maximize and window location
Hi, It is several Maximize function in Fvwm-Crystal. When a new window is opened, a SetEnv made a variable with its window id and its maximized state. 2 temporary files are also created, one with the window width, the other with its height. I done this because I found no other to do what I want and this to survive a restart. May be it is simpler solution, but I didn't find it if it exist. When a given Maximize function is called, I want the window to go in that state. Only the SetEnv is updated. If the same Maximize function is called 2 consecutive times, I want the window to return in its original state and at its original location. The 2 temporary files are used to get the original size. It is a wrapper function: DestroyFunc Window-Resize AddToFunc Window-Resize + I Test (EnvMatch CurrentWindowState_$[w.id] "$0") NS-Default + I TestRc (NoMatch) NS-"$0" which is called by Window-Resize argument where argument can be one of Maximize Minimize Default A100 H100 V100 VHgrow Hgrow Vgrow The function that return to the original size is: DestroyFunc NS-Default AddToFunc NS-Default + I Maximize $[WindowWidth_$[w.id]] $[WindowHeight_$[w.id]] + I SetEnv CurrentWindowState_$[w.id] Default And the other functions look like: DestroyFunc NS-Maximize AddToFunc NS-Maximize + I Maximize True 100 100 + I SetEnv CurrentWindowState_$[w.id] Maximize DestroyFunc NS-Minimize AddToFunc NS-Minimize + I ResizeMaximize direction East 200p 60p + I SetEnv CurrentWindowState_$[w.id] Minimize It is also the Fullscreen function that is called directly, and when quitting the full screen style, NS-Default is called directly. If I open a new window, place it in the middle of the screen and do With NS-Minimize the window get very small and go to its left corner. I try other direction like West, and to add fixeddirection, but I was not able to get it to minimize around its right corner, which I would prefer. Beside that, NS-Maximize -> NS-Minimize -> NS-Minimize work as expected and described above. Another issue is with the FullScreen function. When returning to the normal state, NS-Default is called with: DestroyFunc Fullscreen AddToFunc Fullscreen + I ThisWindow (State 19, !FvwmButtons, !MPlayer) Fullscreen-Stop + I TestRc (NoMatch) ThisWindow (!State 19, !FvwmButtons, !MPlayer) Fullscreen-Start AddToFunc FullScreen-Stop snip + I NS-Default Normally, it work just fine and the window is restored to its original size and location. But sometime after a restart, only the window borders and title style are restored and the window remain in its full maximized state. When this append, I can call FulScreen several times, the window never return to its original size and location. I done some experiment. If I run WindowID id FullScrenn-Stop the problem is the same. If I change NS-Default to + I Maximize False $[WindowWidth_$[w.id]] $[WindowHeight_$[w.id]] the problem is the same. If I change it to + I Maximize True $[WindowWidth_$[w.id]] $[WindowHeight_$[w.id]] I get the original size, but the window is always at the top left border of the screen, that even with a newly opened window or when restoring NS-Default from another Maximize function than FullScreen. And I want the location to be restored too. At restart, it is a fullscreen recover function that apply again the styles to the maximized windows: DestroyFunc Fullscreen-Recover AddToFunc Fullscreen-Recover + I WindowStyle !Title, !Borders, !Handles, Iconifiable, ResizeHintOverride + I UpdateStyles + I WindowStyle State 19 + I WindowStyle State 20 + I Maximize ewmhiwa True 100 100 + I WindowStyle !Maximizable, FixedSize + I UpdateStyles DestroyFunc RecoverFullscreen AddToFunc RecoverFullscreen PipeRead 'for i in $[infostore.TmpDirectory]/fullscreen.19.*; do wid=`basename "$i" | awk --field-separator . \'{print $$3}\'`; echo "+ I WindowId ${wid} Fullscreen-Recover"; done' AddToFunc StartFunction I Schedule 1000 RecoverFullscreen Is it possible to insure the correct location will be restored after a restart and to not use more SetEnv or temporary files for that? Best, Dominique -- "We have the heroes we deserve."