csvsj@garnet.berkeley.edu (Steve Jacobson) (09/02/89)
There are a number of strategies for minimizing "technicolor" color map switching when running concurrent applications that require individual color maps. There are many situations, however, where you must accept that only one application will "look right" at a time. At that point, the window manager becomes very important, since it will allow the user to change color map focus. The twm window manager changes colormap focus by tracking the mouse - wherever the mouse is, that window's colormap is used. This behavior can often be undesirable. For example, one window might have its own unique colormap, and all the other windows use the root window colormap, and only use two entries for foreground and background. If the window with the unique colormap is careful about setting up its colormap, it can match those two entries so the other windows "look right" when the unqie colormap window has the colormap focus. But when another window has the focus, the unique colormap window will go "technicolor", even though the non-unique colormap windows would look ok if the unique colormap were still in place. Even when the user doesn't want to shift keyboard and colormap focus to another window, mouse movements that accidently move the mouse across the window border cause technicolor flickering. Worse things happen when an application with a unique color map uses multiple windows. If the two windows are next to each other or overlap, and they both use the same colormap, it seems reasonable to expect that the colormap focus would not change as the pointer moves across the border from one window to the other. But it looks like the twm created border uses the root window colormap, so as the mouse crosses the border, there's a brief but very disconcerting technicolor flash as the colormap shifts from the unique colormap to the root colormap and back to the unique colormap. Note that these comments about twm apply to the "unfocused" mode. When "click to type" is used, it's hard to use applications with unique colormaps. You have to iconify and deiconify windows to bypass the focus mechanism to get colormaps to switch. However, when you can't change the colormap, you don't have a flicker problem :-). The DEC dxwm window manager handles this a little better. Colormap and keyboard focus are linked together, and focus follows mouse clicks rather than window exits and enters. This reduces technicolor flickering and the user doesn't have to be so careful when moving the mouse. There are still those situations where you might be happier with the colormap from one window being in focus while you type in another. It might be helpful to separate keyboard and colormap focus. For example, twm might have another titlebar doodad to click on for "click to change colormap focus." That way a user could optionally separate the focuses to minimize flickering, minimize "wrong" colormaps, and provide flexibility. Color flickering is disconcerting, but many users who don't like "click to type" might not be happy about having to accept "click to type" to eliminate flickering.
stroyan@hpfcdc.HP.COM (Mike Stroyan) (09/06/89)
> csvsj@garnet.berkeley.edu (Steve Jacobson) / 3:51 pm Sep 1, 1989 / > The twm window manager changes colormap focus by tracking the mouse - wherever > the mouse is, that window's colormap is used > The DEC dxwm window manager handles this a little better. Colormap and > keyboard focus are linked together, and focus follows mouse clicks rather > than window exits and enters. Continuing your survey of window managers, the hpwm and mwm (OSF Motif) window managers have .Xdefaults controlled selection of colormap focus policy. They can be configured to "pointer", "explicit", or "keyboard" colormap focus. The f.focus_color operation can be configured in the .mwmrc file to a button, key or menu. Their is also a "f.next_cmap" operation that cycles through the windows listed in a top level window's WM_COLORMAP_WINDOWS property. Mike Stroyan, stroyan@hpfcla.hp.com
dbb@riscy.dec.com (David Barrett) (09/08/89)
> > The DEC dxwm window manager handles this a little better. Colormap and > > keyboard focus are linked together, and focus follows mouse clicks rather > > than window exits and enters. FYI, the DECwindows window manager, dxwm, can be made to follow the pointer as opposed to it's normal behavior of "click to focus". If anyone is interested in this, send me some mail. David Barrett dbb@riscy.dec.com ..!decwrl!riscy.dec!dbb
bmc@MYCROFT.MAYO.EDU (09/11/89)
I would be very interested in getting dxwm to follow the pointer. thanks for the info. --Bruce ---------------------------------------------------- Bruce M. Cameron bmc@bru.mayo.edu Medical Sciences 1-14 (507) 284-3288 Mayo Foundation WD9CKW Rochester, MN 55905 ----------------------------------------------------
dbb@riscy.dec.com (David Barrett) (09/12/89)
In article <1469@riscy.dec.com>, dbb@riscy.dec.com (David Barrett) writes: > > > The DEC dxwm window manager handles this a little better. Colormap and > > > keyboard focus are linked together, and focus follows mouse clicks rather > > > than window exits and enters. > > > FYI, the DECwindows window manager, dxwm, can be made to follow the pointer > as opposed to it's normal behavior of "click to focus". > > If anyone is interested in this, send me some mail. > > > David Barrett > Well, due to popular demand (25-30 requests in the last few days) here is the compressed and uuencoded version of "cycle.c", which accomplishes the above. The sources are for ULTRIX and VMS. ==========================CUT HERE================================= begin 644 cycle.c.Z M'YV0+U0('$BPH,&#"!,J7"A0 0@5#E6 F$@1"(H1*<;D&<.FC(LQ%"?&< $C M)(@J3*A(28+EQ90K4TSF>!$CQ@L<.2)&!#'D#9P\<M*<04,'1(P<.'"P,(HT M!P@Q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JH2P,RX$<@,$!,D!CF1"]/]6UR\1<7 ?F174DP?_P27&93WJZT59B1F.R<'R1F]R45V!)%^Y!4!, end ==================CUT HERE=============================== David Barrett dbb@riscy.dec.com ..!decwrl!riscy.dec!dbb These opinions are mine.
dbb@riscy.dec.com (David Barrett) (09/13/89)
> > > > > The DEC dxwm window manager handles this a little better. Colormap and > > > > keyboard focus are linked together, and focus follows mouse clicks rather > > > > than window exits and enters. > > > > > > FYI, the DECwindows window manager, dxwm, can be made to follow the pointer > > as opposed to it's normal behavior of "click to focus". > > > > If anyone is interested in this, send me some mail. > > > > > > David Barrett > > > > Well, due to popular demand (25-30 requests in the last few days) here > is the compressed and uuencoded version of "cycle.c", which accomplishes > the above. The sources are for ULTRIX and VMS. /******************************************************************** * * @(#)cycle.c 1.0 ULTRIX/SWS 9/11/89 * * Copyright 1988, 1989 by Digital Equipment Corporation, * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appear in all copies and that * both that copyright notice and this permission notice appear in * supporting documentation, and that the name of Digital Equipment * Corporation not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior permission. * * AUTHOR'S DISCLAIMER: * * This program written by Jatin Desai. * Please use at your own risk. * * Known Bugs/Problems: * 1. Doesn't know sticky property of winodws (brings them to the top * anyways). * 2. Doesn't know if a toplevel window wants input focus or not. It * will ask the 'next' window to take input focus. If it doesn't * take it, hit F5 again. * ********************************************************************/ #include <stdio.h> #ifdef vms #include <decw$include/X.h> #include <decw$include/Xlib.h> #include <decw$include/Xutil.h> #include <decw$include/keysym.h> #else #include <X11/X.h> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/keysym.h> #endif #define forever while(1) static Window GetWMRoot(); static XWMHints *GetWMHints(); /* Recursive */ static int IgnoreDeadWindow(); main(argc,argv) unsigned int argc; char *argv[]; { Display *display; Window wmroot,current,*children,*child; XWMHints *wmhints; int nchildren,i; Window current_focus = (Window) NULL; int revert_to; unsigned int raise_keycode; unsigned int lower_keycode; unsigned int iconify_keycode; #define GrabFunctionKeys() \ { \ XGrabKey(display, raise_keycode, AnyModifier, \ current_focus, True, GrabModeAsync, GrabModeAsync); \ XGrabKey(display, lower_keycode, AnyModifier, \ current_focus, True, GrabModeAsync, GrabModeAsync); \ XGrabKey(display, iconify_keycode, AnyModifier, \ current_focus, True, GrabModeAsync, GrabModeAsync); \ } #define UngrabFunctionKeys() \ { \ XUngrabKey(display, raise_keycode, AnyModifier, \ current_focus, True, GrabModeAsync, GrabModeAsync); \ XUngrabKey(display, lower_keycode, AnyModifier, \ current_focus, True, GrabModeAsync, GrabModeAsync); \ XUngrabKey(display, iconify_keycode, AnyModifier, \ current_focus, True, GrabModeAsync, GrabModeAsync); \ } /* Open the default display */ if (!(display = XOpenDisplay(NULL))) { fprintf(stderr,"Can't open display\n"); exit(0); } /* Find the window manager's pseudo-root window & its children */ wmroot = GetWMRoot(display,&children,&nchildren); XSelectInput(display,wmroot,StructureNotifyMask|SubstructureNotifyMask|K eyPressMask); /* Find out which children have set window manager hints */ for (i = 0, child = children; i < nchildren; ++i, ++child) { if (wmhints = GetWMHints(display,*child,¤t)) { XSelectInput(display,current,EnterWindowMask); XFree(wmhints); } } XFree(children); /* Ignore error when we try to set focus on a window which has died since we received the EnterWindow event */ XSetErrorHandler(IgnoreDeadWindow); /* Grab the function keys used for push & pop */ raise_keycode = XKeysymToKeycode(display, XK_F17); lower_keycode = XKeysymToKeycode(display, XK_F18); iconify_keycode = XKeysymToKeycode(display, XK_F19); XGetInputFocus(display, ¤t_focus, &revert_to); if (current_focus) GrabFunctionKeys(); forever { XEvent event; XMapEvent *map = (XMapEvent *)&event; XEnterWindowEvent *enter = (XEnterWindowEvent *)&event; XDestroyWindowEvent *destroy = (XDestroyWindowEvent *)&event; XKeyEvent *key = (XKeyEvent *) &event; XNextEvent(display,&event); switch (event.type) { case MapNotify: if (wmhints = GetWMHints(display, map->window, ¤t)) { XSelectInput(display,current,EnterWindowMask); XFree(wmhints); } break; case EnterNotify: if (current_focus) UngrabFunctionKeys(); current_focus = enter->window; GrabFunctionKeys(); XSetInputFocus(display, current_focus, RevertToPointerRoot,CurrentTime); break; case DestroyNotify: if (destroy->window == wmroot) { fprintf(stderr,"Window Manager exited.\n"); exit(0); } case KeyPress: if (current_focus) { if (key->keycode == raise_keycode) XRaiseWindow(display, current_focus); else if (key->keycode == lower_keycode) { XWindowAttributes current_attributes; XSetWindowAttributes new_attributes; XGetWindowAttributes(display, current_focus, ¤t_attributes); new_attributes.override_redirect = True; XChangeWindowAttributes(display, current_focus, CWOverrideRedirect, &new_attributes); XLowerWindow(display, current_focus); new_attributes.override_redirect = current_attributes.override_redirect; XChangeWindowAttributes(display, current_focus, CWOverrideRedirect, &new_attributes); } else if (key->keycode == iconify_keycode) { XWMHints hints; UngrabFunctionKeys(); hints.flags = StateHint; hints.initial_state = IconicState; XSetWMHints(display, current_focus, &hints); } } } } } static XWMHints *GetWMHints(display,window,app_window) /* Recursive */ Display *display; Window window,*app_window; { XWMHints *wmhints; if (wmhints = XGetWMHints(display,window)) { *app_window = window; return wmhints; } else { Window root,parent,*children,*child,current = window; int i,nchildren; XQueryTree(display,current,&root,&parent,&children,&nchildren); for (i = 0, child = children; i < nchildren; ++i, ++child) { if (wmhints = GetWMHints(display,*child,app_window)) { XFree(children); return wmhints; } } if (nchildren) XFree(children); return NULL; } } static Window GetWMRoot(display,children,nchildren) Display *display; Window **children; int *nchildren; { Window window,root,parent,*child; XWMHints *wmhints; int x,y,width,height,bw,depth,found; register int i; /* Find first full-screen child of root */ window = RootWindow(display,DefaultScreen(display)); found = False; forever { XQueryTree(display,window,&root,&parent,children,nchildren); for (i = 0, child = *children; i < *nchildren; ++i, ++child) { XGetGeometry(display,*child,&root,&x,&y,&width,&height,&bw,&depth); found = width == DisplayWidth(display,DefaultScreen(display)) && height == DisplayHeight(display,DefaultScreen(display)); if (found) break; } if (found) break; if (*nchildren) XFree(*children); sleep(5); } /* Find first full-screen child of first full-screen child of root */ window = *child; XFree(*children); found = False; forever { XQueryTree(display,window,&root,&parent,children,nchildren); for (i = 0, child = *children; i < *nchildren; ++i, ++child) { XGetGeometry(display,*child,&root,&x,&y,&width,&height,&bw,&depth); found = width == DisplayWidth(display,DefaultScreen(display)) && height == DisplayHeight(display,DefaultScreen(display)); if (found) break; } if (found) break; if (*nchildren) XFree(*children); sleep(5); } /* Found window manager's pseudo-root; return it & its children */ window = *child; XFree(*children); XQueryTree(display,window,&root,&parent,children,nchildren); return window; } static int IgnoreDeadWindow(display,error) Display *display; XErrorEvent *error; { if (error->request_code == 42) /* Life, the Universe, & Everything */ return; else XSetErrorHandler(NULL); } David Barrett dbb@riscy.dec.com ..!decwrl!riscy.dec!dbb