home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gwm18a.zip / revision.c < prev    next >
Lisp/Scheme  |  1995-07-03  |  58KB  |  1,305 lines

  1. /* Copyright 1989 GROUPE BULL -- See license conditions in file COPYRIGHT
  2.  * Copyright 1989 Massachusetts Institute of Technology
  3.  */
  4. /**************************************************************************\
  5. *                                        *
  6. *                @@@@@@  @       @ @       @               *
  7. *               @      @ @       @ @@     @@               *
  8. *              @         @   @   @ @ @   @ @               *
  9. *              @    @@@@ @  @ @  @ @  @ @  @               *
  10. *              @       @ @ @   @ @ @   @   @               *
  11. *               @     @@ @@     @@ @       @               *
  12. *                @@@@@ @ @       @ @       @               *
  13. *                                        *
  14. *  _    ,                                   *
  15. * ' )  /      _/_                   /)                       *
  16. *  /--/ o _   /  __,_  , ,     ____//     __  _ , __o  _   o ______   _       *
  17. * /  (_(_/_)_(__(_) (_(_/_    (_) /__    / (_(<_\/ (__/_)_(_(_) /) )_/_)_  *
  18. *                      /         />                       *
  19. *                     '         </                       *
  20. *                                        *
  21. \**************************************************************************/
  22.  
  23. static char           *RCS_Version = "$GwmVersion: 1.8a $";
  24.  
  25. /* Here is the log of all revisions 
  26.  * NOTE: Revision numbers are non-significant, use Version numbers in all mail.
  27.  */
  28. /* $Log: gwm.shar,v $
  29.  * Revision 1.107  1995/07/03  09:24:22  colas
  30.  * *** Version 1.8a ***
  31.  *
  32.  * logging by sending an udppacket is now disablable at run
  33.  * time by setting the environment variables NO_GWM_LOG or NO_KOALA_SPY
  34.  *
  35.  * Revision 1.106  1995/06/30  08:45:20  colas
  36.  * *******************
  37.  * *** Version 1.8 ***
  38.  * *******************
  39.  *
  40.  * Revision 1.105  1995/06/29  17:02:06  colas
  41.  * modifications to the virtual package of Anders:
  42.  *  - the door-mrg had itself as menu that could mess things up if popping a
  43.  *    menu on it (it has itself as menu, and this recursion messed things)
  44.  *  - added a property on doors: 'action that can contain executable code
  45.  *    triggered after a move via a door
  46.  *  - on end and restart, first move home
  47.  *
  48.  * default .profile.gwm updated to my current profile state
  49.  * new std-virtual.gwm package
  50.  *
  51.  * check if icon windows or pixmaps are not invalid (nulls) to work around
  52.  * emacs19.29 bug
  53.  *
  54.  * Revision 1.104  1995/06/27  13:46:42  colas
  55.  * *** Version 1.7p_beta_5 ***
  56.  *
  57.  * Imake options for RS6000 corrected
  58.  * patch by anders for small X errors
  59.  * patch by anders, menus refused to change shape
  60.  *
  61.  * Revision 1.103  1995/06/07  20:02:23  colas
  62.  * *** Version 1.7p_beta_4 ***
  63.  *
  64.  * Revision 1.102  1995/06/07  12:57:31  colas
  65.  * Revision 1.101  1995/06/07  12:39:23  colas
  66.  *
  67.  * Anders Holst <aho@pdc.kth.se>: fixes the random crashes when using GWM_EXECUTE
  68.  * updates to vtwm
  69.  * 
  70.  * LaTeX doc updated. doc in postscript format included in distrib
  71.  *
  72.  * user.c: some roundoff errors occured when resizing windows at screen 
  73.  * boundaries when confine-windows was set
  74.  *
  75.  * Revision 1.100  1995/05/29  15:56:57  colas
  76.  * simple-win.gwm: new parameters:
  77.  *     label like simple-icon
  78.  *     legend to place the label on sides of window
  79.  *     lpad and rpad: number of () to pad the label with stretchable space
  80.  * bar-max-widths set by default to 1000
  81.  *
  82.  * John Carr <jfc@MIT.EDU>: patches to supress warnings on AIX/RS_6000/xlc
  83.  * rxterm install fixed once more
  84.  *
  85.  * Revision 1.99  1995/05/17  11:23:18  colas
  86.  * *** Version 1.7p_beta_3 ***
  87.  *
  88.  * border-on-shaped new global variable to allow border on shaped windows
  89.  * doc on new extension (to be added to doc) in gwm-1.7p_beta_3.README
  90.  *
  91.  * Revision 1.98  1995/05/17  09:57:07  colas
  92.  *
  93.  * traps bogus clients with a WM_STATE_Withdrawn as its initial_map field in
  94.  * their WM_HINTS property, prints a warning but map them nonetheless
  95.  *
  96.  * Revision 1.97  1995/05/16  16:16:36  colas
  97.  * contrib/scripts/find-bar-nils
  98.  *
  99.  * bar can have abitrary shaped backgrounds (shaped tiles)
  100.  *
  101.  * found (bar-make ()) constructs and replaced them:
  102.  * via the script find-bar-nils
  103.  *
  104.  * autopan.gwm:119: 1 occurences in: (defun make-pan-list (x y xs ys) (with (
  105.  * em-widgets.gwm:137: 1 occurences in: (: widget:scrollbar-make (with (fsm widg
  106.  * mwm-icon.gwm:279: 1 occurences in: (: icon-right-bar (with (cursor frame-cu
  107.  * mwm-icon.gwm:300: 1 occurences in: (: icon-left-bar (with (cursor frame-cur
  108.  * mwm-win.gwm:340: 1 occurences in: (: border-v-bar (with (fsm border.fsm bo
  109.  * pick.gwm:52: 1 occurences in: (defun pick-menu () (with (fsm pick-fsm
  110.  * virtual-pan.gwm:120: 1 occurences in: (defun make-pan-list (x y xs ys) (with (
  111.  * vtwm-window.gwm:277: 1 occurences in: (defun vtwm-borderbar () (with (borderwi
  112.  * widgets.gwm:97: 1 occurences in: (: widget:scrollbar-make (with (fsm widg
  113.  *
  114.  * simple-window modified to take the new customizer simple-icon.stretch, if set
  115.  * to t makes "stretching" legends
  116.  *
  117.  * patches from aho applied (untouched)
  118.  *
  119.  * typo in logging
  120.  *
  121.  * Revision 1.95  1995/05/11  17:06:56  colas
  122.  * better spy
  123.  *
  124.  * Revision 1.94  1995/04/27  16:14:40  colas
  125.  * added some code to ensure window is put back on screen if an error happens
  126.  * while decorating it or its icon
  127.  *
  128.  * spy.c: new function, sends an UDP packet to track GWM usage. you can supress
  129.  * this mecanism if you want by defining -DNO_GWM_LOG. The packet sends only the
  130.  * host name as info, once as start, and once every day. If you dont want the
  131.  * info to appear you can define the string that will be given instead of the
  132.  * host name by the GWM_LOG_ID which must be a string.
  133.  *
  134.  * Revision 1.93  1995/04/26  16:34:51  colas
  135.  * Makefile added in distrib
  136.  *
  137.  * simple-icon.gwm:
  138.  *
  139.  *     - customize item "legend" can now be instead of () or t the strings:
  140.  *       "top" "base" "right" "left" for the positions where you want the string
  141.  *       to appear
  142.  *       e.g: (customize simple-icon any XTerm legend "left")
  143.  *
  144.  *     - new customization item "label" to provide either a fixed string or a
  145.  *       lambda which will be used to filter the label
  146.  *       must return a non-empty string otherwise the unfiltered label is used
  147.  *       e.g: to supress the Netscape: in netscape icon titles
  148.  *       (customize simple-icon any Netscape
  149.  *           label (lambdaq (s) (match "Netscape: \\(.*\\)$" s 1))
  150.  *       )
  151.  *
  152.  * iconify a window doesnt not loose the window anymore in case of error in wool
  153.  * code
  154.  *
  155.  * Revision 1.92  1995/04/25  14:31:09  colas
  156.  * *** Version 1.7p_beta_2 ***
  157.  *
  158.  * Revision 1.91  1995/04/25  08:30:41  colas
  159.  * ejb@ERA.COM (E. Jay Berkenbilt): patches for time on SYSV (posix?)
  160.  *
  161.  * at last: last memory leak bugs fixed:
  162.  *    - one on xpm reading
  163.  *    - one on lambda deallocations
  164.  *    - one on new menu creations (vscreen)
  165.  *
  166.  * Revision 1.90  1995/04/24  17:04:09  colas
  167.  * portability fixes, compiles on solris, irix,...
  168.  *
  169.  * Revision 1.89  1995/04/21  15:23:47  colas
  170.  * ejb@ERA.COM (E. Jay Berkenbilt): patches for time on SYSV (posix?)
  171.  * bug in list-of-windows
  172.  *
  173.  * Revision 1.88  1995/04/20  13:55:51  colas
  174.  * pacth to function param evaluation by Anders Holst <aho@nada.kth.se>
  175.  *
  176.  * problem with XV
  177.  *     believe it or else, but XV thinks that if the position of the client window
  178.  *     is at 0,0 in the WM frame, it thinks that it runs OLWM or MWM and proceed to
  179.  *     look into the window attributes x and y fields to know what is the frame size
  180.  *     OLWM apparently puts there the offsets, and MWM 0,0. (this appears to be
  181.  *     a wrong assumption by looking at MWM source code, BTW)
  182.  *     See xv code: file xvevent.c, HandleEvent, in the case ReparentNotify:
  183.  *
  184.  * Revision 1.87  1995/04/19  15:19:03  colas
  185.  * Michael Welsh Duggan <md5i+@andrew.cmu.edu>: corrections to gwm doc
  186.  * a lot of XQueryTree calls were not followed by XFrees
  187.  *
  188.  * Revision 1.87  1995/04/12  16:24:32  colas
  189.  * Vinnie Shelton <shelton@grind.ICD.Teradyne.COM>:
  190.  *     patches included for better compilation on SVR4 systems
  191.  *     distrib is now a tar of gwm-version_number
  192.  *
  193.  * In makefile: new var EXTRA_INCLUDE for misc -I directives
  194.  *
  195.  * Revision 1.86  1995/04/05  14:43:19  colas
  196.  * *** Version 1.7p_beta_1 ***
  197.  *
  198.  * Revision 1.85  1995/04/05  12:51:45  colas
  199.  * Michael A. Patton <MAP@BBN.COM>:
  200.  *     Sample "diagonal" definitions included in placements.gwm
  201.  *     'rows.diag-ul and 'rows.diag-ur
  202.  *
  203.  * Revision 1.84  1995/04/03  11:13:45  colas
  204.  * XPM files not included anymore!
  205.  * If they are not included in standard, you must in your Make.xxx file
  206.  * gwm-parsers/ fixed
  207.  *
  208.  * ------------------------------------------------------------------------------
  209.  * Anders Holst  (aho@nada.kth.se): <9412121556.AA25326@sans02.nada.kth.se>
  210.  *     There is a small bug in the MWM profile that makes it freeze if
  211.  *     either the variable 'passSelectButton' is set to nil, or if someone
  212.  *     tries to set focus to a window in some other way than clicking in it
  213.  *     files: mwm-icon.gwm mwm-win.gwm
  214.  *
  215.  * ------------------------------------------------------------------------------
  216.  * Anders Holst  (aho@nada.kth.se): <9412121602.AA25335@sans02.nada.kth.se>
  217.  *     Now there is a new version (0.3b) of the VTWM profile for GWM.
  218.  *     Together with it follows a virtual screen package, and an icon manager
  219.  *     package that can be used in other GWM profiles.
  220.  *
  221.  *     In addition to several small bug-fixes and enhencements, these are the
  222.  *     main changes from the last version (0.1):
  223.  *
  224.  *     * All user specifications can now be given in vtwmrc.gwm, which is
  225.  *       thoroughly cleaned up, and contain a lot of comments and
  226.  *       descriptions on how to set most of the variables in the profile.
  227.  *
  228.  *     * Construction of menus is *not* done in a separate file any more,
  229.  *       but is moved into vtwmrc.gwm like all other user specifications.
  230.  *       Several useful tools for construction of menus are added.
  231.  *
  232.  *     * The icon manager is upgraded a lot, and can now also handle normal
  233.  *       icons.
  234.  *
  235.  *     Instead of sending all files out, I have tar:ed and gzip:ed them and
  236.  *     made available through ftp (if you can't reach them there by some
  237.  *     reason, please email me and I will email it back):
  238.  *       thalamus.sans.kth.se:aho/gwm/vtwm-profile-0.2.tar.gz
  239.  *     FILES:
  240.  *     hilite2.xbm
  241.  *     iconify2.xbm
  242.  *     load-icon-mgr.gwm
  243.  *     load-virtual.gwm
  244.  *     menu.xbm
  245.  *     pick.gwm
  246.  *     resize2.xbm
  247.  *     std-func.gwm
  248.  *     virtual-door.gwm
  249.  *     virtual-pan.gwm
  250.  *     virtual.gwm
  251.  *     vtwm-icon-mgr.gwm
  252.  *     vtwm-menu.gwm
  253.  *     vtwm-window.gwm
  254.  *     vtwm-zoom.gwm
  255.  *     vtwm.gwm
  256.  *     vtwmrc.gwm
  257.  *     zoom.xbm
  258.  *     README.icon-mgr
  259.  *     README.virtual
  260.  *     README.vtwm
  261.  *
  262.  * ------------------------------------------------------------------------------
  263.  * Anders Holst  (aho@nada.kth.se): <199501161024.LAA18031@sans02.nada.kth.se>
  264.  *     Here are two more bugfix suggestions. Both concerns the file wops.c
  265.  *     and a patch is included below.
  266.  *
  267.  *     The first one concerns the use of 'window-starts-iconic' to make
  268.  *     windows iconified when they are opened. This collides with the code
  269.  *     for redecorating a window. It says:
  270.  *                 ...
  271.  *             ClientWindowInitialMap(cw);
  272.  *             if (was_mapped) {
  273.  *             ClientWindowMap(cw);
  274.  *             wool_process_unmap_events(window);
  275.  *             }
  276.  *                 ...
  277.  *     If the window was visible before restarting, then it may be first
  278.  *     iconified from ClientWindowInitialMap because 'window-starts-iconic'
  279.  *     is set in 'opening', and then immediately mapped with ClientWindowMap
  280.  *     because it was visible before. This causes both the icon and the
  281.  *     window to be visible at the same time.
  282.  *
  283.  *     I suggest that ClientWindowInitialMap is called only when
  284.  *     ClientWindowMap is not. This fixes this problem. (It does not fix all
  285.  *     problems however. When icon-groups or rooms or an icon manager is
  286.  *     used, "iconifying" a window may rather make it withdrawn, which
  287.  *     confuses ClientWindowInitialMap. This seems however very hard to do
  288.  *     anything about...)
  289.  *
  290.  *
  291.  *     The other bug has to do with shaped windows. They always caused an
  292.  *     "X_error: bad pixmap", either when deleted or redecorated. (Try the
  293.  *     xclock icon for example. Get its pixmap with (window-icon-pixmap) a
  294.  *     few times. Then kill the xclock again). This is because the hint in
  295.  *     the window for the pixmap itself is carefully copied to a new pixmap,
  296.  *     but the hint for the shape is taken directly. When the pixmap is
  297.  *     freed, both the pixmap and the shape mask are freed, causing a new
  298.  *     call to (window-icon-pixmap) to use a freed shape mask. I guess that
  299.  *     the shape mask has to be copied to a new pixmap too.
  300.  *
  301.  *     I try to copy the pixmap below, but I am not sure I do it the right
  302.  *     way. The code seems to work, but surely there must be a less
  303.  *     complicated way to copy a pixmap in X11 !!! Please look at it, if you
  304.  *     can do it with less X11 calls (and please tell me how).
  305.  *
  306.  *     FILES: wops.c
  307.  *
  308.  * ------------------------------------------------------------------------------
  309.  * Anders Holst <aho@nada.kth.se>: <199501161045.LAA18054@sans02.nada.kth.se>
  310.  *     Regarding the problem with '(on geometry-change ...)' , I found why
  311.  *     this caused the window to be unmapped when refreshed. This is because
  312.  *     enabling ConfigureNotify events is done with SubstructureNotify,
  313.  *     which causes GWM to get a whole plethora of other events, like for
  314.  *     example UnmapNotify events. These are expected by GWM from enabling
  315.  *     StructureNotify, and therefore the refreshed window itself is
  316.  *     obediently unmapped by GWM when the UnmapNotify event for the subwindow
  317.  *     that was created above it arrives.
  318.  *
  319.  *     The code below checks that the UnmapNotify comes from a
  320.  *     StructureNotify and not SubstructureNotify. It also makes only *one*
  321.  *     of the possibly many ConfigureNotify events that seem to be generated
  322.  *     from a resize or move to trigger the WOOL code i question.
  323.  *
  324.  *     FILES: client.c
  325.  *
  326.  * ------------------------------------------------------------------------------
  327.  * Anders Holst <aho@nada.kth.se>: <199501161320.OAA18188@sans02.nada.kth.se>
  328.  *
  329.  *     additions to the GWM documentation for vtwm and gwmsend/gwmchat
  330.  *
  331.  * ------------------------------------------------------------------------------
  332.  * Anders Holst <aho@nada.kth.se>: <199501221234.NAA10696@sans02.nada.kth.se>
  333.  *
  334.  *     Two more minor bugfixes, both concerning the file "client.c":
  335.  *
  336.  *     First, sometimes the pull-down menus in Emacs 19 get displaced, by an
  337.  *     amount approximately equal to the size of the window decoration (what
  338.  *     about Epoch or Lucid ?). This occurs only for an emacs that was on
  339.  *     screen before gwm, and before the window is moved. I suggest that
  340.  *     'DecorateWindow' (and 'UnDecorateWindow') should do a
  341.  *     'SendSyntheticMoveEvent', since the decoration may actually move the
  342.  *     client window.
  343.  *
  344.  *     Second, the decoration bars around shaped windows get their border
  345.  *     invisible on the right and under them (but not above and to the
  346.  *     left. (That is, the borders of the *bars*, not of the whole window, I
  347.  *     know that the latter should disappear on shaped windows). It seems
  348.  *     that one has to compensate oneself for the bars borders when the shape
  349.  *     is combined.
  350.  *
  351.  * ------------------------------------------------------------------------------
  352.  * Anders Holst <aho@nada.kth.se>: <199501231236.NAA12961@sans02.nada.kth.se>
  353.  *     'rotate-cut-buffers' causes bus error
  354.  *
  355.  * ------------------------------------------------------------------------------
  356.  * Anders Holst <aho@nada.kth.se>: <199502080902.KAA14661@sans02.nada.kth.se>
  357.  *     QUESTION: Isn't 'delete-nth' supposed to always affect all references
  358.  *     to the same list that it removes elements from ?
  359.  *
  360.  *     Currently there are some situations in which the list is first copied,
  361.  *     and only the copy is changed, for example if you write
  362.  *      (setq tmp1 '(a b c d))
  363.  *      (setq tmp2 tmp1)
  364.  *      (delete-nth 'a 'tmp1)
  365.  *     but not if you do
  366.  *      (delete-nth 'a tmp1)
  367.  *
  368.  *     This copying is what did not work, since it tries to evaluate the
  369.  *     elements of the list to copy. The copying can be made
  370.  *     non-evaluating,
  371.  *
  372.  * ------------------------------------------------------------------------------
  373.  * Anders Holst <aho@nada.kth.se>: <199502080945.KAA14709@sans02.nada.kth.se>
  374.  *
  375.  *     'window-wm-state-update' never worked the way it was done. The only
  376.  *     case when it is useful is when there is a user icon, but since this
  377.  *     function calls Update_XA_WM_STATE which does nothing in that case, it
  378.  *     never had any effect.
  379.  *
  380.  *     Further, when using eg. an icon manager, (or icon groups or rooms) the
  381.  *     window may actually be withdrawn when it is "iconified" so it would be
  382.  *     nice to be able to specify which state I want the window to believe it
  383.  *     is in, with an optional argument 'window, 'icon, or () to
  384.  *     'window-wm-state-update'.
  385.  *
  386.  * ------------------------------------------------------------------------------
  387.  * Anders Holst <aho@nada.kth.se>: <199502080952.KAA14717@sans02.nada.kth.se>
  388.  *
  389.  *     This is not a bugfix actually, but a suggestion for an added function.
  390.  *
  391.  *     I was in desperate need for a function to find out the inner
  392.  *     borderwidth of a window. Otherwise I can not place a new menu in
  393.  *     exactly the same place as an old menu (if the borderwidth when I
  394.  *     create the menu is different from the inner-borderwidth when the menu
  395.  *     gets decorated. This caused the window manager to drift slightly when
  396.  *     used with the MWM-profile).
  397.  *
  398.  *     It turned out it almost was there already, it was just a matter of
  399.  *     declaring it.
  400.  *
  401.  * ------------------------------------------------------------------------------
  402.  * Anders Holst <aho@nada.kth.se>: <199502081015.LAA14723@sans02.nada.kth.se>
  403.  *
  404.  *     Here are three small fixes in the file client.c :
  405.  *
  406.  *     * Some programs made GWM crash during opening, since a MapNotify
  407.  *     event was received for the window currently being decorated.This
  408.  *     caused the opening code to be called twice, the second time with
  409.  *     cw->opening being a NULL pointer...
  410.  *
  411.  *     * Other programs made GWM crash during closing, if process-events
  412.  *     happened to be called from 'closing'. The same reason as above, but
  413.  *     because of DestroyNotify on the window or its icon.
  414.  *
  415.  *     * Windows using 'geometry-change' events could cause a crash during
  416.  *     closing because of an DestroyNotify event from the cw->hook mistaken
  417.  *     as one from cw->client.
  418.  *
  419.  * ------------------------------------------------------------------------------
  420.  * Anders Holst <aho@nada.kth.se>: <199502081027.LAA14733@sans02.nada.kth.se>
  421.  *
  422.  *     By some reason clients using a window-icon-window (like xmailwatcher)
  423.  *     caused GWM to create a 'ghost'-window with the icon in when restarted
  424.  *     (that is, a window (in the case of xmailwatcher called "iconShell")
  425.  *     separate from the icon, which sometimes could live on when
  426.  *     xmailwatcher had died, and then was impossible to kill).
  427.  *
  428.  *     I checked how (the real) MWM handled this, and the only difference I
  429.  *     found was that it made sure the icon window was *unmapped* when MWM
  430.  *     finished. I removed the condition in the corresponding GWM code, and
  431.  *     the problem went away.
  432.  *
  433.  *     This makes more sense too. Why let the icon be mapped just because the
  434.  *     client has to be remapped ?
  435.  *
  436.  * ------------------------------------------------------------------------------
  437.  * Anders Holst <aho@nada.kth.se>: <199502131240.NAA00661@sans02.nada.kth.se>
  438.  *     FILE: data/README.vtwm
  439.  *     Some changes in the VTWM-profile from version 0.2 to 0.3 require
  440.  *     changes to the user customizable file "vtwmrc.gwm". To make it easier
  441.  *     to update "vtwmrc.gwm" for users who have modified it, this file
  442.  *     contains a patch with the most important changes.
  443.  *
  444.  * ------------------------------------------------------------------------------
  445.  * Anders Holst <aho@nada.kth.se>: <199503011701.SAA23377@sans02.nada.kth.se>
  446.  *     I have had problems with xv. Its main window drifts away when new pictures
  447.  *     are loaded. TWM did not have the same problem with xv, so I checked that
  448.  *     code to see what was different.
  449.  *
  450.  *     It turned out that this had to do with XConfigureWindow and window
  451.  *     gravity: According to TWM (line 2359 in events.c in the
  452.  *     twm that comes with X11R5), the ICCCM says that the window gravity
  453.  *     should be followed on a ConfigureRequest. Second, it seems that the
  454.  *     default window gravity should be NorthWest, since when you dont say
  455.  *     anything, the win_gravity in the window attributes is set to 1 but the
  456.  *     gravity mask bit in the WM_NORMAL_HINTS are set to zero. And this is
  457.  *     also what both TWM and MWM assumes.
  458.  *
  459.  *     So, when I changed both these things: If no gravity is given the
  460.  *     window gravity is NorthWest, and the window gravity is followed when
  461.  *     obeying a ConfigureRequest, then xv works perfect with GWM too.
  462.  *
  463.  * ------------------------------------------------------------------------------
  464.  * Anders Holst <aho@nada.kth.se>:
  465.  *
  466.  *     set of patches to handle properly windows without gravity hint
  467.  *     set. behavior based upon TWM.
  468.  *
  469.  * ------------------------------------------------------------------------------
  470.  * Anders Holst <aho@nada.kth.se>: <199503061004.LAA29425@sans02.nada.kth.se>
  471.  *
  472.  *     Alvin C Shelton <acs@world.std.com> wrote:
  473.  *     > I've noticed a weird thing with pop-up
  474.  *     > menus: the first time I select an item from a menu the inverting works
  475.  *     > fine, but the next time any items above the one I selected won't be
  476.  *     > inverted, unless I drag past the item I previously selected and back
  477.  *     > up.
  478.  *
  479.  *     Checking the code in std-popups.gwm, and diffing with the older
  480.  *     version from the time when this worked, it seems that someone tried to
  481.  *     make possible different colors for different items. However,
  482.  *     invert-color is not updated often enough, causing this bug as well as
  483.  *     that different colors wouldn't work anyway.
  484.  *
  485.  * ------------------------------------------------------------------------------
  486.  * Anders Holst <aho@nada.kth.se>: <199503061018.LAA29431@sans02.nada.kth.se>
  487.  *     bug report:
  488.  *     (setq tmp 1) (with (tmp 3 tmp 2) tmp)  => tmp is 3 !!! (should be 1)
  489.  *
  490.  *     Fix by colas to wl_func.c
  491.  *
  492.  * Revision 1.84  1995/03/10  07:14:03  colas
  493.  * XPM files not included anymore! you need to get xpm3.4c library (will work
  494.  *      with any Xpm v3 library)
  495.  * If they are not included in standard, you must in your Make.xxx file
  496.  * gwm-parsers/ fixed, automatically used
  497.  * bugs, compiles fixes for linux
  498.  *
  499.  * Revision 1.83  1994/12/09  13:36:59  colas
  500.  * DISTRIBUTION:
  501.  *     all non-xpm or .gwm files moved from data/ into the new contrib/
  502.  *     subdirectory, including:
  503.  *         emacs-mode/  gwmchat/     gwmsh/       rxterm/
  504.  *         gwm-buffer/  gwmsend/     lisp-modes/  widgets/
  505.  *     command_menus/
  506.  *
  507.  * Anders Holst  <aho@sans.kth.se>:
  508.  *     patches to mwm-utils.gwm for minor bugs
  509.  *     In the distribution there is a
  510.  *     small typo in "obscured-by" that makes it sometimes return the wrong
  511.  *     result. In f.raise_lower is a parenthesis error, that actually makes it
  512.  *     first raise all other windows, before raising the intended window
  513.  *     (which makes it look like the window is lowered before it is
  514.  *     raised...).
  515.  *
  516.  * Anders Holst  <aho@sans.kth.se>:
  517.  *     I wanted a twm-like resize-window, so I began looking in the c-code
  518.  *     for how to do it. Then I discovered that it was enough with a very
  519.  *     small modification to the mwm-like resize-window-style, to make it
  520.  *     handle twm-like resize as well. In the mwm-style, one can "catch" a
  521.  *     corner when dragging along a side. The only thing needed in a twm-like
  522.  *     style, is the same phenomenon when coming from within the window and
  523.  *     hitting a side.
  524.  *
  525.  *     All the code was there already, it was just to relax two if-conditions
  526.  *     a little, to allow treatment of this case. The only difference to the
  527.  *     behavior of the mwm-like resize-style is that if the resize is issued
  528.  *     from eg. a pop-up menu where the pointer ends up inside the window, it
  529.  *     is possible to catch a side by walking out to it. This was not the
  530.  *     case before.
  531.  *
  532.  *     At the same time I discovered a small bug in the mwm-resize-style.
  533.  *     Suppose the standard MWM profile is loaded, and
  534.  *     mwm-resize-style-catch-corners is set to 1. When eg. dragging along
  535.  *     the left side of an xterm or emacs window and hitting the upper left
  536.  *     corner, the window size is not correctly confined to the size-hints,
  537.  *     ie. it will be a fractional number of characters high. The next time a
  538.  *     resize is issued and released without moving, the window will
  539.  *     immediately take a correct size again. This bug was more serious after
  540.  *     having made the above change, so I fixed this too.
  541.  *
  542.  *     After having applied the diff below to the c-code (user.c), this is
  543.  *     what I use as a twm-like resize:
  544.  *
  545.  *     (defun twm-resize-window ()
  546.  *       (with (resize-style 1
  547.  *              mwm-resize-style-corner-size 1
  548.  *              mwm-resize-style-catch-corners 1
  549.  *              cursor (cursor-make 52)
  550.  *              cursor-NW cursor
  551.  *              cursor-NE cursor
  552.  *              cursor-SW cursor
  553.  *              cursor-SE cursor
  554.  *              cursor-N cursor
  555.  *              cursor-W cursor
  556.  *              cursor-S cursor
  557.  *              cursor-E cursor)
  558.  *         (resize-window)))
  559.  *
  560.  * Anders Holst  <aho@sans.kth.se>:
  561.  *     data/gwmsend.c
  562.  *
  563.  * Chan Wilson <cwilson@snarf.engr.sgi.com>:
  564.  *     fixes to clients.c: Update_XA_WM_NAME and Update_XA_WM_ICON_NAME to
  565.  *     display correctly internationalized texts (compounds strings) in window and
  566.  *     icon names
  567.  *
  568.  * Anders Holst  <aho@sans.kth.se>:
  569.  *    "ClientWindowUnmap" was unmapping only the frame, not the client window.
  570.  *
  571.  * Anders Holst  <aho@sans.kth.se>:
  572.  *     It is possible in WOOL to get an empty list that is not equal (nor
  573.  *     "eq") to nil. This caused me complete confusion for hours.
  574.  *     (A related problem, which is fixed at the same time below, is that
  575.  *       (context-save ())
  576.  *     crashes, ie. gives a "WOOL ERROR: Internal error: bus error".)
  577.  *
  578.  * Anders Holst  <aho@sans.kth.se>:
  579.  *     In the gwm-1.7o distribution there is a small bug in "dvrooms.gwm"
  580.  *     causing dvrooms.font to come out as (), instead of as a valid font as
  581.  *     intended. This is because '(defname-in-screen-to () ...)' is used
  582.  *     instead of '(declare-screen-dependent ...)'.
  583.  *
  584.  * Revision 1.82  1994/05/24  14:56:54  colas
  585.  * compiles and runs in R6.
  586.  *
  587.  * Revision 1.81  1994/05/24  14:28:08  colas
  588.  * xpm 3.4b
  589.  *
  590.  * Revision 1.80  1994/05/17  12:28:34  colas
  591.  * David W. Schuler <schuld@vnet.IBM.COM>:
  592.  *     patches to the Imakefile for AIX 1.3.0
  593.  * Eyvind Ness <eyvind.ness@hrp.no>:
  594.  *     could crash on NULL pointer (opening a window which somehow has its
  595.  *     opening field NULL
  596.  * better icon sorter: pack-icons
  597.  * Sven Wischnowsky <oberon@cs.tu-berlin.de>:
  598.  *     patch for the gwm.c file which adds two new options:
  599.  *     -I: this one makes gwm read its stdin (and, of course, evaluate it)
  600.  *     -P: together with -I makes gwm print a simple prompt showing the
  601.  *         number of currently open parentheses
  602.  *     see file data/emacs-mode.readme for details
  603.  *
  604.  * Revision 1.79  1993/09/03  09:37:36  colas
  605.  * *** Version 1.7o ***
  606.  *
  607.  * Revision 1.78  1993/09/03  08:21:52  colas
  608.  * correct tracking of icon pixmap change even from wool with non-rectangular
  609.  *     icons
  610.  * xpm-closeness attributes (defaults to 40000). 0 disables it
  611.  * icon mask hint supported
  612.  * f.exec fixed to call /bin/sh to execute string if only one was given
  613.  *
  614.  * Revision 1.77  1993/08/24  12:30:40  colas
  615.  * icon pixmaps can be non-rectangular (if loaded by xpm)
  616.  * GWM_Propagate_user_events was not reset after send (bruno vasselle)
  617.  *
  618.  * Revision 1.76  1993/07/26  15:28:46  colas
  619.  * Xpm v 3.2g integrated
  620.  *
  621.  * Revision 1.75  1993/07/26  15:06:33  colas
  622.  * Calvin Clark <ckclark@MIT.EDU>:
  623.  *     error in grab lists should not abort decoration
  624.  * mwm: Meta-X no longer maximizes the window by default, since it is annoying
  625.  *     for emacs users (ed.duomo@lambada.oit.unc.edu)
  626.  * more fixes to WM_TAKE_FOCUS Protocol: fix by David Hogan <dhog@cs.su.oz.au>,
  627.  *     reported by John Mackin <john@civil.su.oz.au>
  628.  * simple-win.gwm: typo was preventing color chnage of label with focus-in
  629.  *     bug fix by: Tom Yu <tlyu@MIT.EDU>
  630.  * wbrooms.gwm: new package (like dvrooms) by
  631.  *     William R Burdick <burdick@ecn.purdue.edu>
  632.  *
  633.  * Revision 1.74  1993/05/19  11:52:54  colas
  634.  * *** Version 1.7o (beta 3) ***
  635.  * caret@sword.eng.pyramid.com (Neil Russell):
  636.  *     Syntax error in wool.c; Should not #include inside a function.
  637.  * rjc@cogsci.edinburgh.ac.uk (Richard Caley):
  638.  *     should send both WM_TAKE_FOCUS and set focus for clients (lemacs)
  639.  *     requesting it
  640.  * "Henry S. Thompson" <ht@cogsci.edinburgh.ac.uk>
  641.  *     (pixmap-make width heigth) now take into account tile if it exists
  642.  * "Mike Marques" <mike@ccs.yorku.ca>:
  643.  *     calls in the Imakefile contain spaces
  644.  * kenw%bilbo@ihs.com (Ken Weinert)
  645.  *     def_bitmap.h: charcaters should be unsigned
  646.  * dwight@toolucky.llnl.gov ( Dwight Shih )
  647.  *     color problems in dvroom name editing
  648.  * Julian Gosnell <jules@tomen-ele.co.jp>
  649.  *     patches to fix the print-window-info problem.
  650.  *
  651.  * Revision 1.73  1993/02/24  15:37:11  colas
  652.  * more memoryh leaks fixed?
  653.  *
  654.  * Revision 1.72  1993/02/05  16:03:22  colas
  655.  * -k and -K options:
  656.  * Dan Griscom <griscom@media.mit.edu>:
  657.  *     It's the "-k pid" option, which takes a process id as an
  658.  *     argument. When gwm has finished initializing, it sends a signal (SIGALRM
  659.  *     by default) to the given process. So, if you do the following lines:
  660.  *         sleep 15 & pid=$!
  661.  *     gwm -k $pid &
  662.  *     wait $pid
  663.  *     then your init shell script will pause until gwm has finished initializing.
  664.  *     -K signal_num sets the signal number to signal_num instead of SIGALRM (14)
  665.  * Steven Charlton <steven@cs.ualberta.ca>:
  666.  *     problems on multi-screen servers (multiple menu items, etc...)
  667.  * Reg Quinton <reggers@julian.uwo.ca:
  668.  *     resource menuShadeColor is not set for mono screens with Mmw profile
  669.  * memory leak seems fixed
  670.  *
  671.  * Revision 1.71  1993/01/14  14:23:36  colas
  672.  * Glen Whitney <gwhitney@math.ucla.edu>:
  673.  *     diffs to correct a couple of bugs in Version 1.1 of the
  674.  *     Mwm emulator for gwm. The bugs were:
  675.  *          1. Mwm profile does not work on monochrome displays.
  676.  *          2. Mwm profile leaves "closed" windows hanging on the screen,
  677.  *             useless. (Thanks to Rodney McDuff, mcduff@newton.physics.uq.oz.au)
  678.  * Olaf Kirch <okir@mathematik.th-darmstadt.de>:
  679.  *     patches for compilation with flex instead of lex, and clean-ups of the
  680.  *     code. You must use the provided wool.flex intead of wool.lex then.
  681.  *     Olaf writes:
  682.  *     When compiling gwm under Linux, I came across the problem that
  683.  *     flex didn't produce the analyzer gwm expected. I therefore
  684.  *     rewrote it to work with flex.
  685.  *
  686.  *     However, there is a little kludge here. You use input redirection
  687.  *     to parse include files and the like. However, currently the
  688.  *     workings of lex are not very well hidden, you always do
  689.  *
  690.  *         old_type = wool_input_redirect(....,old_buffer);
  691.  *         /* parse new stream * /
  692.  *         wool_input_redirect(old_type, 0, NULL);
  693.  *         wool_unput(old_buffer);
  694.  *
  695.  *     This seems to be too much tailored to the customs of lex. How
  696.  *     about
  697.  *
  698.  *         wool_input_push(new_type, new_stream);
  699.  *         /* parse new stream * /
  700.  *         wool_pop();
  701.  *
  702.  *     That's what I did to make flex work, sort of. I didn't want to
  703.  *     start changing wool.c, so instead, I use the old wool_input_redirect(),
  704.  *     and check if old_buffer is NULL or not. When it isn't, I push the
  705.  *     old buffer onto a stack, and substitute the new one. Else, I pop
  706.  *     the latest buffer from the stack. However, you can easily modify
  707.  *     the code to return a 'buffer handle' when substituting a new stream,
  708.  *     and write wool_replace_stream().
  709.  *
  710.  *     There are a couple of other minor changes I made to make it compile
  711.  *     on Linux. It runs fine (although a bit slow, since I only have 4M at the
  712.  *     moment).
  713.  *
  714.  * Revision 1.70  92/12/09  15:34:13  colas
  715.  * Michael A. Patton <MAP@lcs.mit.edu> : bug when executing unmap+map in wool
  716.  * 
  717.  * Revision 1.69  1992/08/28  12:44:10  colas
  718.  * could do a bus error in idraw popups
  719.  * patch to compile wl_event.c offset code on mips compilers:
  720.  *       -DNO_STRUCTURE_OFFSETS to be added
  721.  * move-opaque.gwm: call to process-exposes to avoid crashes
  722.  *       tsm@cs.brown.edu (Timothy Miller)
  723.  * some windows could be left unmapped
  724.  *
  725.  * Revision 1.68  1992/08/11  09:36:22  colas
  726.  * *** Version 1.7m ***
  727.  * data/mwm-utils.gwm was lacking a newline at the end of file!
  728.  *
  729.  * Revision 1.67  1992/08/10  12:49:57  colas
  730.  * gwm-mode.el renamed into gwm-buffer.el
  731.  *
  732.  * Revision 1.66  1992/08/04  09:10:03  colas
  733.  * *** Version 1.7m ***
  734.  * -DUSE_STANDARD_MALLOC compilation flag for running with purify
  735.  * some bugs and memory leaks corrected by running under PURIFY
  736.  *
  737.  * Revision 1.65  1992/07/29  08:22:23  colas
  738.  * never use CurrentTime in icccm protocols for buggy clients
  739.  *
  740.  * Revision 1.64  1992/07/27  11:08:51  colas
  741.  * map-on-raise was always applied!
  742.  * licence ==> license
  743.  * cstruble@gnu.ai.mit.edu (Craig Struble) Short/int comparison pb
  744.  * load: on absolute pathnames, do not add extensions
  745.  *       check that extension is not already there before adding it
  746.  * active-labels in simple-win corrected
  747.  * blk@vanity.mitre.org (Brian L. Kahn): drop-menus packages for use with epoch
  748.  *     files in data/:
  749.  *     drop-menus.doc drop-menus.gwm style.gwm widgets.el widgets.gwm
  750.  * Calvin Clark <ckclark@mit.edu>: bad handling of the sibling field in
  751.  *     ConfigureRequest events
  752.  * Doug Bogia <bogia@cs.uiuc.edu>: no more button overriding by mon-keys.gwm
  753.  * Mike Fletcher <fletch@cad.gatech.edu>: data/gwm-mode.el interactive buffer
  754.  *     under epoch for remotely executing gwm code
  755.  * Glen Whitney <gwhitney@math.ucla.edu>: new version of the mwm emulator.
  756.  *     mwm files overriden, but saved in mwm-emul-1.0.tar.Z in ftp sites
  757.  *     see mwm-emulation.txt
  758.  * New context flag for windows: ignore-take-focus (default ()). If set, the
  759.  *     WM_TAKE_FOCUS protocol is never used for the window, even if it is set by
  760.  *     the window
  761.  *
  762.  * Revision 1.63  1992/03/02  11:22:06  colas
  763.  * *** Version 1.7l ***
  764.  * fast.gwm (for gwm -f fast), to make a very primitive, fast starting WM
  765.  *     ejb@era.com (Jay Berkenbilt)
  766.  * bugs to twm profile corrected (would core dump after a while) by
  767.  *     Dag Diesen <dagdis@ifi.uio.no>
  768.  * UseInstalledXpm in Imakefile to use already installed XPM library
  769.  *     klute@irb.informatik.uni-dortmund.de (Rainer Klute)
  770.  * epoch.gwm updated.
  771.  * never-warp-pointer variable to disable all calls to warp pointer
  772.  *     tim@stanley.cis.brown.edu (Timothy Miller)
  773.  * some changes for compiling on stellar (Timothy Miller)
  774.  * map-on-raise flag interpreted by decoration to know if we must de-iconify a
  775.  *     window if the client raises it (FrameMaker)
  776.  * button mapping removed from mon-keys.gwm
  777.  *     Doug Bogia <bogia@cs.uiuc.edu>
  778.  * (setq confine-windows t) was overriden by unconf-move in .profile.gwm
  779.  *     Doug Bogia <bogia@cs.uiuc.edu>
  780.  * gwm now ignores directories when loading files
  781.  *
  782.  * Revision 1.62  1992/02/12  14:50:23  colas
  783.  * *** Version 1.7k ***
  784.  * 'background key in meter function was ignored
  785.  *     (bug report from "Mike Marques" <mike@apex.yorku.ca>)
  786.  *
  787.  * Revision 1.61  1992/02/11  15:25:18  colas
  788.  * *** Version 1.7k ***
  789.  * Philippe Kaplan's additions of hooks for external window management (not yet
  790.  *     documented...)
  791.  * (property-change any) is now possible (a stupid check was preventing it)
  792.  *
  793.  * Revision 1.60  1992/02/11  14:43:39  colas
  794.  * *** Version 1.7j ***
  795.  * new resources for simple-icon:
  796.  *     simple-icon.plug-name forces the icon name
  797.  *     simple-icon.no-center-plug forces icon to ignore application pixmap
  798.  *
  799.  * Revision 1.59  1992/02/11  10:01:26  colas
  800.  * *** Version 1.7j ***
  801.  * Michael Bloom <mb@ttidca.tti.com> patches for interviews
  802.  * data/en-recover.gwm utility code from Eyvind Ness <eyvind@hrp.no>
  803.  * new simple-icon.plug-name argument to simple-icon
  804.  * window-group has now sanity checks to always return a list or ()
  805.  * potential bug in GC fixed
  806.  *
  807.  * Revision 1.58  1991/10/21  09:32:13  colas
  808.  * *** Version 1.7i ***
  809.  * traps idraw bad hints
  810.  *
  811.  * Revision 1.57  1991/10/04  13:37:58  colas
  812.  * *** Version 1.7h ***
  813.  * ***** R5 TAPE VERSION *****
  814.  * uses xpm v3.0
  815.  * icons with no center plug resize when bars resize Mike Liang <mike@lsil.com>
  816.  *
  817.  * Revision 1.56  1991/10/02  17:04:16  colas
  818.  * *** Version 1.7g ***
  819.  * bug in error message in undefined key (Philippe Kaplan)
  820.  * xpm/Imakefile corrections by Pekka.Nikander@ngs.fi
  821.  * bug with some false window-group hints
  822.  * data/amc-lisp.el copyright changed to X one, with author agreement
  823.  * Doug Bogia patches for resize into upper-left of screen
  824.  * confined resize problems fixed
  825.  * blk@zoot.cca.cr.rockwell.com (Barry L. Kaplan) GWM-Lisp major mode for Emacs
  826.  *   included in distrib
  827.  * Hugues.Leroy@irisa.fr (Hugues Leroy) additions of rxcmdtool to rxterm.script
  828.  * PROBLEMS file for listing hints & tips
  829.  *
  830.  * Revision 1.55  1991/09/13  08:21:32  colas
  831.  * *** Version 1.7f ***
  832.  * (send-key-to-window "aB@#" alone) works as expected
  833.  *
  834.  * Revision 1.54  1991/09/13  08:12:58  colas
  835.  * *** Version 1.7f ***
  836.  * Upgrade of xpm (3.0b) to read xpm v2 pixmaps
  837.  * Do trap bad transient-for windows
  838.  * blk@zoot.cca.cr.rockwell.com (Barry L. Kaplan) bug in submenu execution in mwm
  839.  *
  840.  * Revision 1.53  1991/09/10  12:43:52  colas
  841.  * small bug in doc
  842.  *
  843.  * Revision 1.51  1991/09/10  12:21:38  colas
  844.  * XPM v3.0a library included
  845.  *
  846.  * Revision 1.50  1991/09/10  09:17:51  colas
  847.  * malloc.c from wool.
  848.  * no more resource manager bugs. were due to ...
  849.  * no more XIOError trapping.
  850.  *
  851.  * Revision 1.49  1991/09/06  15:28:39  colas
  852.  * xpm/FILES included
  853.  * color-make-rgb function added by dab@berserkly.cray.com (David Borman)
  854.  * do not use bzero anymore on sparc
  855.  *
  856.  * Revision 1.48  1991/08/29  11:24:56  colas
  857.  * *** Version 1.7d ***
  858.  * Transient-for windows buggy
  859.  *
  860.  * Revision 1.47  1991/08/28  15:10:52  colas
  861.  * *** Version 1.7c ***
  862.  * Compiles with R5
  863.  * John Carr <jfc@ATHENA.MIT.EDU> patches for IBM RT and RS/6000, X11R5, ansiC
  864.  * more careful during window decoration (for xrn crashes)
  865.  * Sun4 bugs corrected
  866.  * window-to-client and client-to-window functions
  867.  *
  868.  * Revision 1.46  1991/08/22  07:28:48  colas
  869.  * machine names truncated to first dot
  870.  *
  871.  * Revision 1.45  1991/08/20  08:14:32  colas
  872.  * bug in flushing grab events queue
  873.  *
  874.  * Revision 1.44  1991/08/15  16:44:15  colas
  875.  * patches to README by MAP@lcs.mit.edu (Michael A. Patton) + revised myself
  876.  * window-icon? documented and coded in C
  877.  *
  878.  * Revision 1.43  1991/08/15  14:40:10  colas
  879.  * *** Version 1.7a ***
  880.  * window-is-valid & wob-is-valid functions
  881.  * data/Imakefile repaired
  882.  * NOXEHTYPE flag for pre-R4 includes
  883.  * make wool makes a command-line interpreter version
  884.  * dvrooms additions by Dwight Shih <dwight@s1.gov>
  885.  *
  886.  * Revision 1.42  1991/08/14  09:37:31  colas
  887.  * *** 1.7 ***
  888.  * distrib details
  889.  *
  890.  * Revision 1.41  1991/08/13  17:11:45  colas
  891.  * *** 1.7 ***
  892.  * small bugs
  893.  *
  894.  * Revision 1.40  1991/08/07  14:54:20  colas
  895.  * (draw-text pixmap x y font text)
  896.  * bug in redecorating windows in groups fixed
  897.  * profile-colas.gwm included
  898.  *
  899.  * Revision 1.39  1991/07/29  14:57:30  colas
  900.  * *** 1.7_epsilon ***
  901.  *
  902.  * Revision 1.38  1991/07/29  13:35:11  colas
  903.  * place-button with 3D-look
  904.  * null string for the window-client-name badly matched (patch by Doug Bogia)
  905.  * no-set-focus not always set properly (patch by Doug Bogia)
  906.  * amc-lisp.el emacs style included
  907.  * data/Imakefile automatically generated
  908.  * fixed crash when client quits immediately after a colormap change request
  909.  *     (problem showed by Frank Mangin <mangin@sa.inria.fr>)
  910.  * no more use of makedepend in makefile
  911.  * draw-rectangle
  912.  * color-free
  913.  * no need to put pressed button as modifier for release events anymore
  914.  * double-buttonpress was bugged: acted as a buttonpress
  915.  *
  916.  * Revision 1.37  1991/06/24  11:50:08  colas
  917.  * madler@apollo.com (Michael Adler) dims_outer_to_inner() in client.c:
  918.  *     failed to account for the border width of the decoration
  919.  * Eyvind Ness <eyvind@hrp.no> near-mouse placement policy included in file
  920.  *     near-mouse.gwm
  921.  * mods to isolate wool from gwm
  922.  * client moving only one coord would move to 0
  923.  * xid-to-wob function
  924.  * delete-read-properties pointer to delete x properties after reading them
  925.  * GWM_EXECUTE gets deleted after being read
  926.  * client-name context var was ignored in place-menu
  927.  * client-info menu wasn't movable
  928.  * new place-button in utils.gwm
  929.  *
  930.  * Revision 1.36  1991/04/29  16:17:03  colas
  931.  * window-icon checks for window existence
  932.  *
  933.  * Revision 1.35  1991/04/11  15:02:25  colas
  934.  * (= "foo" 'foo) didn't work!
  935.  * good resource for host names with dots in them DGREEN@IBM.COM (Dan R.Greening)
  936.  * proper use of * in resource specs
  937.  * uses xpm library v3.0a
  938.  * tar archive includes gwm dir (tar c gwm instead of tar c .)
  939.  *
  940.  * Revision 1.34  1991/04/05  14:25:17  colas
  941.  * William.Lott@ARDATH.SLISP.CS.CMU.EDU: (wob-borderpixel <pixmap>) broken
  942.  * restart code fixed also in mwm.gwm and twm.gwm
  943.  * keys works in vscreen window now
  944.  * no-decoration.gwm wasn't included
  945.  * John Carr patches for IBM PC-RTs under BSD (AOS), not AIX
  946.  * Mike Newton patches for building on DG AViiON
  947.  * Dan R. Greening patches to Imakefile for IBM RS-6000
  948.  * sven@tde.lth.se (Sven Mattisson) patches for Sequent Symmetry DYNIX 3.0.17
  949.  * meters stay in place
  950.  *
  951.  * Revision 1.33  91/01/11  17:03:13  colas
  952.  * John Carr <jfc@ATHENA.MIT.EDU>: fixes for correct argument types in functions
  953.  * 
  954.  * Revision 1.32  91/01/09  14:25:35  colas
  955.  * Jay Berkenbilt <qjb@ATHENA.MIT.EDU>: closing code executed at the end/restart
  956.  *     of gwm was just value of closing, causing random crashes
  957.  * icon-groups-old.gwm  simple-icon-old.gwm  simple-win-old.gwm files were
  958.  *     missing from distrib (for mwm and twm profiles)
  959.  * 
  960.  * Revision 1.31  91/01/08  18:30:58  colas
  961.  * av@cs.uta.fi (Arto V. Viitanen) ids too long for appolo C compiler
  962.  * Mike Newton: new version of mon-keys.gwm
  963.  * iconification of clients not matched by describe-window failed
  964.  * Mike Newton: pop menu on root with any modifier on menu button
  965.  * Mike Newton: patches to gwm_utils & compile flags for Data General AViiON
  966.  * tom@srl.mew.mei.co.jp (Tom Borgstrom): OBJS1 in Imakefile
  967.  * Malloc Bug in xpm librairy for monochrome pixmaps
  968.  * 
  969.  * Revision 1.30  91/01/02  16:08:15  colas
  970.  * *** Version 1.7_gamma ***
  971.  * basebars on shaped windows was buggy
  972.  * John Mackin <john@cs.su.oz.au> corrections to the man page
  973.  * send-key-to-window adds automatically shift as modifier if letter is uppercase
  974.  *     Frank Mangin <Frank.Mangin@mirsa.inria.fr>
  975.  * CHANGES file updated (no doc yet)
  976.  * 
  977.  * Revision 1.29  90/12/27  18:47:43  colas
  978.  * new events enter-window-not-from-grab & leave-window-not-from-grab
  979.  * default action for menus now works
  980.  * random bus error bug in redecorate window fixed
  981.  * menu labels can now be pixmaps or lists (evaluated)
  982.  * "\xXX" was bugged
  983.  * new color-components function
  984.  * 
  985.  * Revision 1.28  90/12/26  20:40:04  colas
  986.  * 1.7_beta version
  987.  * 
  988.  * Revision 1.27  90/12/26  20:17:57  colas
  989.  * icon-groups-old.gwm included in distrib
  990.  * quick & dirty patches to twm & mwm modes to run with 1.7 standard profile
  991.  * reparse-standard-behaviors simplified
  992.  * xpm v2.8 library included
  993.  * colors in pixmap-load can be either string or pixel value (number)
  994.  * qjb vscreen package
  995.  * now you must include standard-behavior in your fsms, is not included anymore
  996.  *     in window/icon-behavior
  997.  * 
  998.  * Revision 1.26  90/12/13  18:48:51  colas
  999.  * rxterm.script recognize full internet adresses
  1000.  * rotate-cut-buffer was bugged
  1001.  * 
  1002.  * Revision 1.25  90/12/11  17:58:07  colas
  1003.  * Wool bug: (boundp '()) was returning ()!
  1004.  * new "customize" function to generically redefine decos by context
  1005.  * set-icon now works again
  1006.  * "client info" menu item pops up a window
  1007.  * try to trap bus errors in current-mouse-pos (in move-opaque)
  1008.  * clients with window-icon started iconic before gwm starts work now OK
  1009.  *   (bug report: John Mackin <john@cs.su.oz.au>, David Hogan <dhog@cs.su.oz.au>)
  1010.  * 
  1011.  * Revision 1.24  90/11/29  17:10:45  colas
  1012.  * setting window-size bugged on windows which diddn't have resize incr hints
  1013.  * warning: float package makes redecorate on an icon crash
  1014.  * (pixmap-load filename [symbol1 color1 ... symbolN colorN])
  1015.  * icon-groups add iconify others in group
  1016.  * icon boxes of phk
  1017.  * all resources uses the class.name.name.machine resource spec
  1018.  * trace package included
  1019.  * raise-on-move, -resize and -iconify
  1020.  * make-string-usable-for-resource-key traps now blanks as well as . *
  1021.  * decos are evaluated ONLY at decoration time, not at profile read time
  1022.  * decos are recursively evaluated till obtaining a window description
  1023.  * do not call opening code on unmapped window group leaders
  1024.  * 
  1025.  * Revision 1.23  90/11/13  16:44:21  colas
  1026.  * the propagate argument to send-user-event stayed set after function invocation
  1027.  * reads xpm v2 pixmap files
  1028.  * 
  1029.  * Revision 1.22  90/11/08  19:03:23  colas
  1030.  * menu-make skips nil entries
  1031.  * float up or down
  1032.  * was mis-interpreting some WM hints
  1033.  * didn't handle resizes or move too early after initial mapping (this one was
  1034.  *        a tought one!)
  1035.  * multi-item entries in menus
  1036.  * menu code reorganized
  1037.  * simple-icon and term-icon customizable
  1038.  * traps Program sizes <= 1 for this brain-dead motif 1.1!
  1039.  * could crash if window was destroyed too fast
  1040.  * default menu action triggered if clicked too fast for menu to pop
  1041.  * 
  1042.  * Revision 1.21  90/10/22  11:52:47  colas
  1043.  * removed Scott Blachowicz's modifs to placement.gwm (bus errors?)
  1044.  * duanev@mcc.com (Duane Voth) buttonrelease inst. of press on icon of s-ed-ed-win
  1045.  * simple-win title stayed in gray
  1046.  * Rod Whitby: floating windows (was called auto-raise) (float)
  1047.  *         unconfined-move (unconf-move)
  1048.  *         F5 and F7 (suntools-keys)
  1049.  * 
  1050.  * Revision 1.20  90/08/02  14:39:35  colas
  1051.  * Scott Blachowicz  new patches to placements.gwm
  1052.  * 
  1053.  * Revision 1.19  90/07/26  18:16:02  colas
  1054.  * Carl Witty <cwitty@portia.stanford.edu> patches included:
  1055.  *     confined windows could get 1 pixel off the right & down of screen
  1056.  *     mwm profile:
  1057.  *         f.maximize corrected:
  1058.  *             If executed from a menu, it didn't correctly change the
  1059.  *         state of the window's zoom button
  1060.  *         It did set the zoom button's pixmap incorrectly, although
  1061.  *         this was corrected as soon as a leave-window event is generated.
  1062.  *     keyboard menu traversal more sensible
  1063.  *     new functions:
  1064.  *         (f.eval (? "Hello")) will print hello when it is executed.
  1065.  *         (f.identify) pops up a window which giving information about the
  1066.  *         current window.
  1067.  *         (f.delete) uses the WM_DELETE_WINDOW protocol to delete a window.
  1068.  *         (f.load "mwm") will reload the mwm profile.
  1069.  *         (f.raise_lower) is my version, which doesn't raise a window unless
  1070.  *         another on-screen window actually obscures it.
  1071.  *         (f.raise_move) is obvious.
  1072.  *         (f.refresh_win) didn't do anything before; now it does.
  1073.  *         (f.warpto "emacs") warps the mouse to the first emacs window found
  1074.  *         and brings it to the front.  I implemented it for a friend who 
  1075.  *         likes twm.
  1076.  *     I didn't like the look of disabled menu items in the mwm profile, with
  1077.  *         that line drawn through them, so I added some modifications to 
  1078.  *         allow disabled menu items to be displayed in a different color
  1079.  *         instead.
  1080.  *     Here are some patches to make the icon manager in the twm profile act
  1081.  *         more like the one in the X11R4 twm.  That is, when the cursor is in
  1082.  *     the icon manager, the focus is set to the window whose bar the cursor
  1083.  *     is over.  The patches also change it so that the icon manager doesn't
  1084.  *     resize when a window is iconified or deiconified.
  1085.  * 
  1086.  * Revision 1.18  90/07/26  17:10:08  colas
  1087.  * John Carr <jfc@ATHENA.MIT.EDU>: redecorating windows have no background
  1088.  *     (was not added last time)
  1089.  * dvroom.auto-add
  1090.  * XGetProperties were not tested enough for failure: pb of iconification
  1091.  * (exit insts...) were evaluating inst after restoring old context!
  1092.  * exit out of a for didn't restore correcetly the old values
  1093.  * screen-tile & icon-pixmap are defaulted-to intead of set
  1094.  * select for events sooner on windows, should not loose early resize events
  1095.  * casey@gauss.llnl.gov (Casey Leedom): namespace doc entries out of order
  1096.  * Scott Blachowicz <scott%grlab%hpubvwa@beaver.cs.washington.edu>
  1097.  *     patch to placements.gwm for decreasing lists
  1098.  * 
  1099.  * Revision 1.17  90/05/28  16:04:36  colas
  1100.  * *** Version 1.6b ***
  1101.  * Jay Berkenbilt <qjb@ATHENA.MIT.EDU> east gravities bugged
  1102.  * MW_STATE now overrides initial_state, even in "normal" case
  1103.  * John Carr <jfc@ATHENA.MIT.EDU>: redecorating windows have no background
  1104.  * 
  1105.  * Revision 1.16  90/05/23  18:06:18  colas
  1106.  * duanev@mcc.com (Duane Voth): dvrooms maintain a GWM_ROOM window property 
  1107.  *     on window to put them back in room managers 
  1108.  * mwm profile: closing a xmh sub window was generating X errors
  1109.  * button 2 in icon of simple-ed-win works now 
  1110.  *     (Andrew Simms <ams@acm.Princeton.EDU>)
  1111.  * tmiller@suna0.cs.uiuc.edu withdrawing a client having an "user-icon" set
  1112.  *     didn't work (such as a dvroom)
  1113.  * 
  1114.  * Revision 1.15  90/05/21  10:57:55  colas
  1115.  * Rod Whitby <rwhitby@austek.oz.au> added the variable "confine-windows" to keep
  1116.  *     interactive moves and resizes confined to screen boundaries.
  1117.  * added confine-windows support to move-opaque
  1118.  * More Muller patches to mwm emulation code
  1119.  * Rod Whitby <rwhitby@austek.oz.au> xterm-list more defaultable
  1120.  * cwitty@portia.stanford.edu reallocating when adding strings could fail if
  1121.  *     new_size was > 2*old_size
  1122.  * when match fails, returns () when caleed with 2args, "" otherwise.
  1123.  * Doug Bogia <bogia@suna0.cs.uiuc.edu> The no-set-focus did not allow the 
  1124.  *     autocolormap to work.
  1125.  * new global values class-name & client-name for class of placed menus
  1126.  * 
  1127.  * Revision 1.14  90/05/09  15:18:47  colas
  1128.  * *** Version 1.6a ***
  1129.  * icon-groups: new members always started iconic if leader had -iconic flag
  1130.  * deplibs added in Imakefile (hleroy@irisa.fr (Hugues Leroy))
  1131.  * compil without USER_DEBUG dacseg@uts.amdahl.com (Scott E. Garfinkle)
  1132.  * icon description evalution was done too early
  1133.  * bus errors trapped Ray Nickson <Ray.Nickson@comp.vuw.ac.nz>
  1134.  * mult-screen confusion fixed <eirik@elf.TN.Cornell.EDU>
  1135.  * map on an alerady mapped leader bug <carroll@suna0.cs.uiuc.edu>
  1136.  * WM_CLIENT_MACHINE was atom inst.of string Carl Witty <cwitty@cs.stanford.edu>
  1137.  * Dana Chee <dana@bellcore.com> bitmaps stipple were offset
  1138.  * Dana Chee blank pixmaps in mwm icons
  1139.  * Jay Berkenbilt <qjb@ATHENA.MIT.EDU> replacing menu inside screen was
  1140.  *     forgetting borders
  1141.  * could drop resize events Simon Kaplan <kaplan@cs.uiuc.edu>
  1142.  * bug in destroying placed menus fixed Carl Witty <cwitty@portia.stanford.edu>
  1143.  * (pop-menu 'here) was buggy not work (--> no cascading mwm menus)
  1144.  * kill gwm was doing a fatal error, quits now.
  1145.  * 
  1146.  * Revision 1.13  90/03/30  15:45:55  colas
  1147.  * *** Version 1.6 ***
  1148.  * could unmap group leader on startup
  1149.  * DecorateWindow was resetting TargetWob
  1150.  * bar with nothing didn't took size of pixmap (Gilles.Muller@irisa.fr)
  1151.  * icon group works on clienst iconified on stratup
  1152.  * iconify on startup calls (iconify-window)
  1153.  * icon-groups.excluded
  1154.  * 
  1155.  * Revision 1.12  90/03/28  18:42:11  colas
  1156.  * Gilles.Muller@irisa.fr: mwm error when closing xmh acc. window
  1157.  * mwm bugs when closing xmh sub-windows
  1158.  * can put a 'expr. in set-icon (Steve Anderson <anderson@sapir.cog.jhu.edu>)
  1159.  * do not map withdrawn windows on ending
  1160.  * doc was saying 'fixed instead of 'here. doc corrected.
  1161.  * deltabutton
  1162.  * 
  1163.  * Revision 1.11  90/03/23  18:54:18  colas
  1164.  * bug repaired in ref count: Vincent Bouthors <vincent@mirsa.inria.fr>
  1165.  *    (: a (:b 20)) (with (a 0) (: b 0)) would free the number 20
  1166.  * OpenWindow could modify the current window
  1167.  * withdrawing a window could destroy it
  1168.  * no user-positioning for transient windows cwitty@CSLI.STANFORD.EDU(Carl Witty)
  1169.  * traps bogus inc hints
  1170.  * 
  1171.  * Revision 1.10  90/03/20  16:10:56  colas
  1172.  * bar-min-width was ignored (Carl Witty <cwitty@portia.stanford.edu>)
  1173.  * shaped windows were offset by window borderwidth
  1174.  *     (Carl Witty <cwitty@portia.stanford.edu>)
  1175.  * simple-icon wasn't working in multi screen mode (found by
  1176.  *     Doug Bogia (bogia@cs.uiuc.edu))
  1177.  * changing the name after editing window name left in black/black
  1178.  *     Doug Bogia (bogia@cs.uiuc.edu)
  1179.  * window-icon-pixmap-id
  1180.  * patch to the README file by casey@gauss.llnl.gov (Casey Leedom)
  1181.  * or returned an un-evaluted argument!
  1182.  * new sort-icons and (rows.limits 'sort func)
  1183.  * reparse-standard-behaviors
  1184.  * action-button, select-button, menu-button
  1185.  * current-event-... return 0 (instead of ()) if event wasn't relevant
  1186.  * 
  1187.  * Revision 1.9  90/03/12  17:34:08  colas
  1188.  * Doug Bogia <bogia@cs.uiuc.edu>: patches to the no-set-focus code
  1189.  * 
  1190.  * Revision 1.8  90/03/07  18:14:51  colas
  1191.  * *** Version 1.5e ***
  1192.  * zoom-win.gwm renamed as mwm-zoom-win.gwm
  1193.  * GetWMNormalHints used
  1194.  * no more use of obsolete flags
  1195.  * 
  1196.  * Revision 1.7  90/02/28  21:52:02  colas
  1197.  * *** Version 1.5d ***
  1198.  * arup's patches to twm
  1199.  * doc of simple-icon.legend (false is now default)
  1200.  * if placed a menu before wool_host_name was referenced, crash
  1201.  * move-opaque part of distrib
  1202.  * bugs in mwm
  1203.  * better mwm menus
  1204.  * mwm de-iconify raises
  1205.  * 
  1206.  * Revision 1.6  90/02/21  15:18:06  colas
  1207.  * *** Version 1.5c ***
  1208.  * window-icon checked for existence
  1209.  * machine name set on menus
  1210.  * new hostname active value
  1211.  * elapsed-time returns real time in milliseconds
  1212.  * mwm was asking for placement of user-positioned windows
  1213.  * window-icon? was bugged
  1214.  * mwm didn't set colormaps
  1215.  * 
  1216.  * Revision 1.5.1.9  90/02/15  19:54:36  colas
  1217.  * *** Version 1.5b ***
  1218.  * Rod Whitby <rwhitby@adl.austek.oz.au> : visibility events
  1219.  * new naming with $Version: (in file gwm.shar,n)
  1220.  * GWM_EXECUTE built in
  1221.  * make-string-usable-for-resource-key (no more in window-name)
  1222.  * GWM_RUNNING property and GwmWindow hidden window
  1223.  * mwm profile gets resources by class and show window icon names on icons
  1224.  * 
  1225.  * Revision 1.5.1.8  90/02/14  17:59:40  colas
  1226.  * icon-groups could make windows disappear
  1227.  * restart with icon windows works now.
  1228.  * -r for retrying, waiting for you to kill other wm
  1229.  * menu popping could break (parent kept being set to old window)
  1230.  * do not take into account icon windows in window groups
  1231.  *     Michael Urban <urban%rcc@rand.org>
  1232.  * only check for WM_STATE on startup rjt@sedist.cray.com (Randy Thomas)
  1233.  * nice man page by casey@gauss.llnl.gov (Casey Leedom) (gwm.man)
  1234.  * delete-window no longer have the side-effect of changing current wob
  1235.  * standard profile: icons update names on window-icon-name change
  1236.  * window-icon-name on root was crashing gwm
  1237.  * all register decls removed
  1238.  * 
  1239.  * Revision 1.5.1.7  90/02/01  14:52:27  colas
  1240.  * re-install colormap if client changes its WM_COLORMAP_WINDOWS list
  1241.  * casey@gauss.llnl.gov (Casey Leedom) patches to the Imakefile
  1242.  * dummy man page
  1243.  * 
  1244.  * 
  1245.  * Revision 1.5.1.6  90/02/01  11:16:07  colas
  1246.  * patch for interactive386 by drich%dialogic@uunet.UU.NET (Dan Rich)
  1247.  * patch from John Carr <jfc@ATHENA.MIT.EDU> for keeping same screen
  1248.  *     during opening & close 
  1249.  * term-icon as idraw drawings
  1250.  * juha@tds.kth.se (Juha Sarlin): bugs in RCSRevNum in doc
  1251.  * 
  1252.  * Revision 1.5.1.5  89/12/20  19:05:27  colas
  1253.  * december release of arup's twm package
  1254.  * menu min/max width was ignored when resized
  1255.  * process-events nary
  1256.  * flag reenter_on_opening
  1257.  * 
  1258.  * Revision 1.5.1.3  89/12/20  15:25:08  colas
  1259.  * 2 patches from dab@berserkly.cray.com (David Borman) for DEC BSD4.4 (-DSTUPID)
  1260.  * x, y, gravity, borderwidth & borderpixel in "meter"
  1261.  * meter returns list of previous values that can be re-given to meter
  1262.  * Redecorating sometimes unmapped the window
  1263.  * meter nows shrinks and grows (was only growing before)
  1264.  * window-creep fixed
  1265.  * Dlists package cleaned up
  1266.  * 
  1267.  * Revision 1.5.1.2  89/12/07  17:41:09  colas
  1268.  * map-notify event
  1269.  * 
  1270.  * Revision 1.5.1.1  89/12/05  13:36:20  colas
  1271.  * new rcs system
  1272.  * was sending 2 icccm events on resize+move
  1273.  * on withdraw request, undecorate the window to start afresh on new map.
  1274.  * menu-max-width & menu-min-width
  1275.  * 
  1276.  * Revision 1.5  89/11/27 18:10:00 colas
  1277.  * X11R4 RELEASE    
  1278.  * - is now n-ary (- n1 (+ n2 n3 n4))
  1279.  */
  1280.  
  1281. #include "wool.h"
  1282. DECLARE_strchr;
  1283.  
  1284. char GWM_version_name[20];
  1285.  
  1286. GWM_print_banner()
  1287. {
  1288.     strncpy(GWM_version_name, strchr(RCS_Version, ' ') + 1,
  1289.         strchr(RCS_Version + 1, '$') - strchr(RCS_Version, ' ') - 2);
  1290.     printf("GWM %s %s\n", GWM_version_name,
  1291. #ifdef DEBUG
  1292.        " (debug)"            /* debug-mode banner */
  1293. #else                    /* DEBUG */
  1294.        " (gwm@mirsa.inria.fr)"
  1295. #endif                    /* DEBUG */
  1296.        );
  1297. }
  1298.  
  1299. /* WARNING: This is an internal rcs number for my eyes only. The official
  1300.  * one is found in RCS_Version!
  1301.  */
  1302.  
  1303. static char           *RCS_Header = 
  1304. "$Id: gwm.shar,v 1.107 1995/07/03 09:24:22 colas Exp $";
  1305.