Not stable, seems something else need to add.
I had some doubt of the ‘Next $0’ within the function, so i still want to get the $[w.id]. for i want remember exactlly the window started from the ‘StartShadede’. if i got the id, i can use sth like this ‘SetEnv Env0 $[w.id]’ and then use ‘WindowId $[Env0] Thumbnail’ in the future.
The reason why you get that fault is most likely because the name of the window does not match the executable – hence ‘gvim’ sets itself to ‘GVIM’.
It is stable, you just need to re-read everything in my last post, and realise why I am telling you to use FvwmEvent.
Aww, bless you. Why’s that? I certainly don’t make this stuff up just so that people can pick and choose which pieces I might be lying about or which have a hidden meaning. Next ($0) does what you might think it does – it operates on the next window matching whatever “$0” might be. Since there might be a new window with this name, it will hence match that window. What made you think it wasn’t necessary? That’s the most imporant part.
No, you really don’t want to use the approach. The windowID set lasts only as long as that specific window is running. If you were to close it and reopen the same window, it would have a different windowID rendering all your useless SetEnvs useless (and utterly superfluous in thought and approach, anyway). Since you only have a specific number of windows likely you’ll want to shade, I’ll again point you to FvwmEvent.
Your suggestion of something like this:
+ I Exec exec $0
+ I WindowId $0 Focus
Doesn’t even make sense – the window might not even have been mapped, plus the use of “WindowId $0” isn’t passing the ID of the window at all, it’s using the name of it.
If it’s just a case of wanting to reshade a window later on then you can do something like this:
Next (some_name) WindowShade
… Along with any form of “!Shaded” or “Shaded” conditions.
So we come back to the notion of my previous post realising thatFvwmEvent is the better option.
Your calling it “StartThumbnail” by the way is a misnomer – you’re shading a window, not iconifying it.