[comp.windows.x] Problems with XWMHints.window_group ?????

tlastran@esunix.UUCP (Tom LaStrange) (06/22/88)

Has anyone tried using the window_group field of the XWMHints
structure?  I am trying to implement some window group operations
in twm and it appears that by the time twm gets the XWMHints
structure, the window_group member no longer contains meaningful
data.  I have included the little test program that I am using,
it creates 3 windows and tries to give each a window_group value.
If I am doing something wrong or if this is already a known problem
could someone let me know?

Also it appears that xterm and xclock have the WindowGroupHint bit
set.  Is this right?  What group are they supposed to belong to?

Thanks,

Tom LaStrange
Evans & Sutherland Computer Corporation

UUCP Address:  {ihnp4,seismo}!utah-cs!utah-gr!uplherc!esunix!tlastran
Alternate:     {ihnp4,decvax}!decwrl!esunix!tlastran


-------------------

#include <stdio.h>
#include <signal.h>
#include <fcntl.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/cursorfont.h>

Display *dpy;			/* which display are we talking to */

#define TRUE 1

main(argc, argv)
    int argc;
    char *argv[];
{
    Window w1, w2, w3;
    Window Root;
    XWMHints wmhints1, wmhints2, wmhints3;
    long Foreground, Background;
    XEvent event;

    if ((dpy = XOpenDisplay("")) == NULL)
    {
	fprintf(stderr, "testtwm: can't open the display\n");
	exit(1);
    }
    Root = RootWindow(dpy, DefaultScreen(dpy));
    Foreground = BlackPixel(dpy, DefaultScreen(dpy));
    Background = WhitePixel(dpy, DefaultScreen(dpy));

    w1 = XCreateSimpleWindow(dpy, Root, 100, 100, 100, 100, 2,
	Foreground, Background);

    w2 = XCreateSimpleWindow(dpy, Root, 250, 100, 100, 100, 2,
	Foreground, Background);

    w3 = XCreateSimpleWindow(dpy, Root, 400, 100, 100, 100, 2,
	Foreground, Background);

    wmhints1.flags = WindowGroupHint;
    wmhints1.window_group = w1;

    wmhints2.flags = WindowGroupHint;
    wmhints2.window_group = w1;

    wmhints3.flags = WindowGroupHint;
    wmhints3.window_group = w1;

    printf("w1 = 0x%x\n", w1);

    XSetWMHints(dpy, w1, &wmhints1);
    XSetWMHints(dpy, w2, &wmhints2);
    XSetWMHints(dpy, w3, &wmhints3);

    XSelectInput(dpy, w1, Expose);
    XSelectInput(dpy, w2, Expose);
    XSelectInput(dpy, w3, Expose);
    XMapWindow(dpy, w1);
    XMapWindow(dpy, w2);
    XMapWindow(dpy, w3);

    while (TRUE)
    {
	XNextEvent(dpy, &event);
    }
}

markc@stan.UUCP (06/23/88)

Tom and others trying to use windowGroup hints-
	On the tape we recieved of XV11.R2, there is a bug in handling XWMHints.
The fix is to change the constant NumPropWMHintsElements from 8 to 9 in the
file lib/X/Xatomtype.h.  After doing this, you will need to recompile X lib
and any clients that use window manager hints.


                                        Mark A. Connell
                                        Solutions Are Everything, Inc.
                                        2190 Miller Drive
                                        Longmont, Co	80501
                                        (303) 772-3400
                                         ...!ncar!boulder!stan!markc