While running CTWM on a machine with no accelaration support for the X
server (incidentally a Sun SPARCstation 5 with OpenBSD), I was
surprised to notice that windows that typically occupy all the
workspaces in my configuration [1] /also/ were redrawn when entering a
new workspace. I found this rather disturbing.
I had a look in the code to find out why this was happening. It seems
that when the user is about to change to another workspace, CTWM
creates a new root window and raises the windows that should occupy
that workspace on top of it. This is a slow process on old X servers
and slow machines [2] since the total area of the windows has to be
redrawn.
I really see no good reason for creating a new root window, so I
removed this
w = XCreateWindow (dpy, Scr->Root, 0, 0,
(unsigned int) Scr->MyDisplayWidth,
(unsigned int) Scr->MyDisplayHeight,
(unsigned int) 0,
CopyFromParent, (unsigned int) CopyFromParent,
(Visual *) CopyFromParent, valuemask,
&attr);
XMapWindow (dpy, w);
[...]
XDestroyWindow (dpy, w);
from workmgr.c:GotoWorkSpace() and tried it. Now, CTWM doesn't touch
windows that already occupy the new workspace. It feels much
faster. Try it out!
I don't think this breaks functionality if you want another background
pixmap on different workspaces, because pixmaps should be stored in
the X server anyway and the X server will simply blit it into place on
the existing root window. Right? Did I miss something?
How about testing this change? And if it doesn't break any
configurations, how about applying it to the next release?
Richard, how much time do you have for CTWM stuff right now? How about
handing out some write bits for the CVS?
[1] Typically things like xbiff and dclock.
[2] As if I had any other kind...
--
MC, http://hack.org/mc/