home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume4 / rtl-wm / patch1 next >
Encoding:
Text File  |  1989-06-28  |  7.7 KB  |  269 lines

  1. Path: uunet!island!argv
  2. From: argv@island.uu.net (Dan Heller)
  3. Newsgroups: comp.sources.x
  4. Subject: v04i034: rtl-wm patches, Patch1
  5. Message-ID: <848@island.uu.net>
  6. Date: 29 Jun 89 01:05:52 GMT
  7. Organization: Island Graphics, Marin County, California
  8. Lines: 258
  9. Approved: island!argv@sun.com
  10.  
  11. Submitted-by: ucbcad!cadillac.siemens.com!berman ( A. Michael Berman )
  12. Posting-number: Volume 4, Issue 34
  13. Archive-name: rtl-wm/patch1
  14.  
  15. [ These patches should be applied to the rtl window manager that exists
  16.   in the windowmgrs directory under the "contrib" tree in the X11R3
  17.   distribution.  This window manager has not been posted to comp.sources.x.
  18.   You may or may not have 1 patch fail: menu.c has a line which looks
  19.   like this:
  20.     static char def_menu_font[] = "8x13bold.snf";
  21.   Your version may not have the .snf at the end of the font.  If so, you
  22.   will get a failed patch.  The new version should have "8x13" (no "bold"
  23.   and no ".snf").  Edit by hand if you get a failed patch.  The following
  24.   text comes from Michael Berman at Siemens Research --argv ]
  25.  
  26. June 6, 1989
  27. Siemens Corporate Research
  28.  
  29. This is the first official patch to the RTL Tiled Window
  30. Manager.  It should be applied to the source as included with
  31. the original X11V3 distribution.  Two bugs are fixed:
  32.  
  33. 1.    The font specified for the menus had the R2 name
  34. instead of R3.  With an incorrect font name, the program
  35. crashed or hung, depending on the environment.  (Thanks to
  36. several people who quickly diagnosed this problem and sent patches.) 
  37.  
  38. 2.    The menus would occasionally get into a "flashing"
  39. state, where a submenu would quickly appear and disappear
  40. repeatedly. 
  41.  
  42. NOTES:     
  43. 1. This system does not compile properly with gcc.  Use cc. 
  44. 2. In order to show the correct patchlevel, force
  45. recompilation of input.c  (the dependencies in the makefile
  46. are not correct.)
  47.  
  48. Send comments, bugs, etc. to:
  49.     rtl@siemens.com
  50.  
  51.  
  52. *** ../Rel5.1/patchlevel.h    Wed Sep  7 10:07:13 1988
  53. --- patchlevel.h    Fri Jun  2 17:21:37 1989
  54. ***************
  55. *** 1 ****
  56. ! #define PATCHLEVEL 0
  57. --- 1,2 ----
  58. ! /* @(#)patchlevel.h    5.2  6/2/89 */
  59. ! #define PATCHLEVEL 1
  60. *** ../Rel5.1/track_menu.c    Wed Sep  7 10:49:05 1988
  61. --- track_menu.c    Fri Jun  2 15:11:53 1989
  62. ***************
  63. *** 1,5 ****
  64.   #ifndef lint
  65. ! static char sccs_id[] = "%W%  %H%";
  66.   #endif
  67.   
  68.   /*
  69. --- 1,5 ----
  70.   #ifndef lint
  71. ! static char sccs_id[] = "@(#)track_menu.c    5.2  6/2/89";
  72.   #endif
  73.   
  74.   /*
  75. ***************
  76. *** 38,44 ****
  77.   #include "rtlmenuP.h"
  78.   #include "evsaveX.h"
  79.   
  80. ! #define CLICK_TIME 290 /* in milliseconds */
  81.   #define CursorLockMask (ButtonReleaseMask)
  82.   
  83.   /* Event macros */
  84. --- 38,44 ----
  85.   #include "rtlmenuP.h"
  86.   #include "evsaveX.h"
  87.   
  88. ! #define CLICK_TIME 360 /* in milliseconds */
  89.   #define CursorLockMask (ButtonReleaseMask)
  90.   
  91.   /* Event macros */
  92. ***************
  93. *** 71,76 ****
  94. --- 71,80 ----
  95.        (EventType(rep) == FocusOut))
  96.   #define KeyEvent(rep) \
  97.       ((EventType(rep) == KeyPress) || (EventType(rep) == KeyRelease))
  98. + #define SelectChildX(menu, item, rep) \
  99. +     (TestOptionFlag(menu, fixedchild)? \
  100. +      (MenuX(menu) + ItemGetArrowPosition(item)): \
  101. +      MIN(MenuX(menu) + ItemGetArrowPosition(item),EventXRootX(rep)))
  102.   
  103.   /* Possible states for the state machine */
  104.   typedef enum
  105. ***************
  106. *** 510,516 ****
  107.       /* entered item in "auto pop-up zone", i.e., over pull-right arrow. */
  108.       LockCursor(ItemWindow(current_item));
  109.       TossExtraMoves(ItemWindow(current_item));
  110. !     if (PushSubmenu(EventXRootX(rep)))
  111.       {
  112.           LockCursor(ItemWindow(current_item));
  113.           PlacePointer(current_menu, current_item); 
  114. --- 514,520 ----
  115.       /* entered item in "auto pop-up zone", i.e., over pull-right arrow. */
  116.       LockCursor(ItemWindow(current_item));
  117.       TossExtraMoves(ItemWindow(current_item));
  118. !     if (PushSubmenu(SelectChildX(current_menu, current_item, rep)))
  119.       {
  120.           LockCursor(ItemWindow(current_item));
  121.           PlacePointer(current_menu, current_item); 
  122. ***************
  123. *** 636,644 ****
  124.       if (NewX >= Trigger)
  125.       {
  126.           LockCursor(ItemWindow(current_item));
  127. !         childX = TestOptionFlag(current_menu, fixedchild)?
  128. !         (MenuX(current_menu) + ItemGetArrowPosition(current_item)):
  129. !             EventXRootX(rep);
  130.           Trigger = NotSet;
  131.           if (PushSubmenu(childX))
  132.           {
  133. --- 640,646 ----
  134.       if (NewX >= Trigger)
  135.       {
  136.           LockCursor(ItemWindow(current_item));
  137. !         childX = SelectChildX(current_menu, current_item, rep);
  138.           Trigger = NotSet;
  139.           if (PushSubmenu(childX))
  140.           {
  141. *** ../Rel5.1/menu.c    Wed Sep  7 10:49:02 1988
  142. --- menu.c    Mon Jun  5 10:07:54 1989
  143. ***************
  144. *** 1,5 ****
  145.   #ifndef lint
  146. ! static char sccs_id[] = "%W%  %H%";
  147.   #endif
  148.   
  149.   /*
  150. --- 1,5 ----
  151.   #ifndef lint
  152. ! static char sccs_id[] = "@(#)menu.c    5.2  6/5/89";
  153.   #endif
  154.   
  155.   /*
  156. ***************
  157. *** 87,93 ****
  158.   #define MakeEven(x) ((x%2 == 0)? x : x-1)
  159.   #define    InvertPlane        1
  160.   
  161. ! static char def_menu_font[] = "8x13bold.snf";
  162.   Menu MenuDefault;
  163.   char *MenuDefaultFont;
  164.   static XAssocTable *menu_table;
  165. --- 87,93 ----
  166.   #define MakeEven(x) ((x%2 == 0)? x : x-1)
  167.   #define    InvertPlane        1
  168.   
  169. ! static char def_menu_font[] = "8x13";
  170.   Menu MenuDefault;
  171.   char *MenuDefaultFont;
  172.   static XAssocTable *menu_table;
  173. ***************
  174. *** 220,228 ****
  175.       MenuDefault.menuItemPad =
  176.       (cp = XGetDefault(MenuDefault.display, name, "MenuPad")) ? atoi(cp) : 3;
  177.       MenuDefault.delta = Default_Delta;
  178. !     MenuDefaultFont =
  179. !     (cp = XGetDefault(MenuDefault.display, name, "MenuFont")) ?
  180. !         cp : def_menu_font;
  181.       MenuDefault.menuOptions = options;
  182.   }
  183.   
  184. --- 220,231 ----
  185.       MenuDefault.menuItemPad =
  186.       (cp = XGetDefault(MenuDefault.display, name, "MenuPad")) ? atoi(cp) : 3;
  187.       MenuDefault.delta = Default_Delta;
  188. !     /* Find a font to use -- checking for defaults */
  189. !     cp = XGetDefault(MenuDefault.display, name, "MenuFont");
  190. !     if (cp == NULL)
  191. !     cp = XGetDefault(MenuDefault.display, name, "Font");
  192. !     MenuDefaultFont = (cp == NULL)? def_menu_font : cp;
  193.       MenuDefault.menuOptions = options;
  194.   }
  195.   
  196. ***************
  197. *** 277,283 ****
  198.       MenuScreen(menu) = screen;
  199.   
  200.       /* If the menu font hasn't yet been gotten, go get it. */
  201. !     MenuFontInfo(menu) = XLoadQueryFont (display, MenuDefaultFont);
  202.       gcValues.font = MenuFontInfo(menu)->fid;
  203.   
  204.       /* If the menu cursor hasn't been given, make a default one. */
  205. --- 280,309 ----
  206.       MenuScreen(menu) = screen;
  207.   
  208.       /* If the menu font hasn't yet been gotten, go get it. */
  209. !     /* Try to open selected default font.  If that fails, check to see      */
  210. !     /* if the one we're opening is the "fall back" default, def_menu_font-- */
  211. !     /* if it is, exit.  Otherwise, try def_menu_font -- if that fails, exit */
  212. !     if ((MenuFontInfo(menu) = XLoadQueryFont (display, MenuDefaultFont))
  213. !      == NULL)
  214. !     {
  215. !     if (!strcmp(MenuDefaultFont,def_menu_font))
  216. !     {
  217. !         fprintf(stderr, "rtl: couldn't open font \"%s\"\n",
  218. !             MenuDefaultFont);
  219. !         exit(1);
  220. !     }
  221. !     else
  222. !     {
  223. !         if ((MenuFontInfo(menu) = XLoadQueryFont (display, def_menu_font))
  224. !         == NULL)
  225. !         {
  226. !         fprintf(stderr, "rtl: couldn't open font \"%s\" or \"%s\"\n",
  227. !             MenuDefaultFont, def_menu_font);
  228. !         exit(1);
  229. !         }
  230. !     }
  231. !     }
  232.       gcValues.font = MenuFontInfo(menu)->fid;
  233.   
  234.       /* If the menu cursor hasn't been given, make a default one. */
  235. *** ../Rel5.1/tilemenu.c    Wed Sep  7 10:49:04 1988
  236. --- tilemenu.c    Mon Jun  5 13:57:47 1989
  237. ***************
  238. *** 1,5 ****
  239.   #ifndef lint
  240. ! static char sccs_id[] = "%W%  %H%";
  241.   #endif
  242.   
  243.   /*
  244. --- 1,5 ----
  245.   #ifndef lint
  246. ! static char sccs_id[] = "@(#)tilemenu.c    5.2  6/5/89";
  247.   #endif
  248.   
  249.   /*
  250. ***************
  251. *** 37,43 ****
  252.       
  253.   #include <X11/Xlib.h>
  254.       
  255. ! #define DEFAULT_MENU_MASK (RTLMenuOptionsMask)0x0f
  256.   
  257.   extern Display *dpy;
  258.   extern int scrn;
  259. --- 37,43 ----
  260.       
  261.   #include <X11/Xlib.h>
  262.       
  263. ! #define DEFAULT_MENU_MASK (RTLMenuOptionsMask)0x0b /* clickokay, savebits, rightoffset */
  264.   
  265.   extern Display *dpy;
  266.   extern int scrn;
  267.