[comp.windows.x] twm not handling XA_COLORMAP_WINDOWS

etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) (10/23/90)

Has anyone gotten the XA_COLORMAP_WINDOWS property to work
properly with twm?  I do not mean XA_COLORMAP_WINDOW which
works just fine.  Below is a sample
program that seems to work just fine for other ICCCM window
managers, but not for twm:

#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Core.h>
#include <stdio.h>

main(argc,argv)
	char *argv[] ;
{
	Widget wd = XtInitialize("test","Test",NULL,0,&argc,argv) ;
	Colormap c1 = XCreateColormap(XtDisplay(wd),DefaultRootWindow(XtDisplay(wd)),DefaultVisualOfScreen(XtScreen(wd)),AllocNone) ;
	Widget w1 ;
	XColor col ;
	col.flags = DoRed | DoGreen | DoBlue ;
	col.red = 256 * 256 ;
	col.green = 256 * 100 ;
	col.blue = 256 * 100 ;
	XAllocColor(XtDisplay(wd),c1,&col) ;
	w1 = XtVaCreateManagedWidget("w1",coreWidgetClass,wd,
		XtNcolormap,c1,
		XtNbackground,col.pixel,
		XtNwidth,100,
		XtNheight,200,
		NULL) ;
	XtRealizeWidget(wd) ;
	{
		Widget list[2] ;
		list[0] = wd ;
		list[1] = w1 ;
		XtSetWMColormapWindows(wd,list,2) ;
	}
	XtMainLoop() ;
}

-- 
					Eric Taylor
					Baylor College of Medicine
					etaylor@wilkins.bmc.tmc.edu
					(713) 798-3776

converse@EXPO.LCS.MIT.EDU (10/23/90)

> Has anyone gotten the XA_COLORMAP_WINDOWS property to work
> properly with twm?  I do not mean XA_COLORMAP_WINDOW which
> works just fine.  Below is a sample
> program that seems to work just fine for other ICCCM window
> managers, but not for twm:

It works fine here.  The twm that I am running has a few more fixes
that are available in the public patches, but I suspect that they
do not make a difference on this issue.

The WM_COLORMAP_WINDOWS property is introduced in section 4.1.2.8
of the ICCCM and discussed further in section 4.1.8.   twm may 
embody a different colormap focus policy than other ICCC compliant
window managers, yet twm is compliant.   

twm will install the first n unique colormap(s) of the windows listed
in the property.   For most common machines, n = 1.  For twm, colormap 
focus is held by an application when the mouse pointer is within the
toplevel window.   The reason why nothing happens when you move the
pointer into the sample program's window is that the first window on
the list is the toplevel window and its colormap is the default colormap.

If you change the order of the list, you should see the other colormap
installed.  You can change the order of the list by writing the list 
in your program in a different order, and, while your program is 
running and has the colormap focus, twm allows you to change the order 
of the list with the f.colormap function. 

You have to bind it to a key.  There's no way to make it work from
a menu.  

"F4"	= 	:all	:f.colormap "next"


Donna Converse