Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!jarthur!elroy.jpl.nasa.gov!decwrl!ucbvax!hplabs!hpfcso!stroyan From: stroyan@hpfcso.HP.COM (Mike Stroyan) Newsgroups: comp.windows.x Subject: Re: Help with WM_COLORMAP_WINDOWS Message-ID: <7320004@hpfcso.HP.COM> Date: 4 Mar 90 00:14:12 GMT References: <2909@polstra.UUCP> Organization: Hewlett-Packard, Fort Collins, CO, USA Lines: 30 > 7. Calls XtSetWMColormapWindows(toplevel, &canvas, 1). > 8. Calls XtAppMainLoop(). > If I use xprop to print out the window properties, it says > "WM_COLORMAP_WINDOWS(WINDOW): window id # 0x800002", and that is indeed > the correct window ID for my canvas widget. > > I have found that I can get the desired behavior by replacing step 6 with an > XSetWindowColormap on my toplevel window, and eliminating step 7 entirely. > But I don't really *want* my toplevel window to use the RGB_GREEN_MAP. According to the ICCCM the top level window's colormap will be given priority over the windows in the WM_COLORMAP_WINDOWS property unless the top level window also appears in the property. Use something like the following code to list your canvas window ahead of the toplevel window. { Widget list[2]; list[0] = canvas; list[1] = toplevel; XtSetWMColormapWindows(toplevel, list, 2); } Unless the server can actually support multiple simultaneous colormaps, this will make the server always use RGB_GREEN_MAP when colormap focus is on your application window. You might want to consider swapping the order of the WM_COLORMAP_WINDOWS list based on Enter and Leave events on the canvas widget. Mike Stroyan, stroyan@hpfcla.hp.com