One of my favourite features of FVWM is the virtual desktops. However, one thing annoys me much with the virtual desktops: when I start an application from an xterm (rxvt) and then switch to another desktop, the application will end up on the desktop I switched to instead of the one I started it on. For special cases, e.g., the web browser, I tie it to a specific desktop with FVWM styles, but this doesn’t work with things (e.g., rxvt terminals) which I want to start on different desktops.
I know that this is a tricky problem to solve, since it is very hard to actually know from where an application was initially started. The FVWM wiki has a sort-of-solution to this (the site is down so I cannot link it), but that solution requires you to manually specify the name of the application you start, i.e.,
start-on-desk 1 xterm* xterm ...
what I instead would like is to have the application by default start on the desktop it was started on. I have also devised a way of doing this, although it is buggy and not very optimal.
The solution I had in mind is to use Xnest to start a nested X session for each desktop, and then run all windows inside the nested desktops. For example, if I have two desktops, these would be (perhaps) DISPLAY :1 and :2, and an application started on the first desk would automatically end up there - unless DISPLAY is set to :2. Each desk Xnest would run a FVWM “slave” which controls windows on that desktop, and one “master” FVWM would manage the Xnests themselves. The master session has keyboard shortcuts to switch between desks, but otherwise just forwards everything to the slaves managing the Xnest’s. Starting something on another desk is simple: just set DISPLAY before starting it. xmove can be used to move already started windows between desks.
Problems: Xnest is buggy and seems to have problems with the keyboard modifier state, see
blogs.gnome.org/view/markmc/2005/06/22/1
. I’ve tried a quick hack of this idea, and the modifier state is a real problem. The above link contains a fix to Xnest, but I’m really too lazy to rebuild X before I ask you about opinions. Does anyone else have better ideas on how to achieve this? Perhaps even xmove could be used by itself, starting windows on the virtual server xmove provides and then intelligently moving them back to the “normal” server. Ideas?
// Simon
[color=red]Edited by theBlackDragon:
–> Moved from General Fvwm discussion[/color]