home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume3 / xplaces.r3 / patch1 next >
Encoding:
Text File  |  1989-02-08  |  6.2 KB  |  244 lines

  1. Path: uunet!wyse!mikew
  2. From: mikew@wyse.wyse.com (Mike Wexler)
  3. Newsgroups: comp.sources.x
  4. Subject: v03i010:  toolplaces replacement, Patch1
  5. Message-ID: <2044@wyse.wyse.com>
  6. Date: 8 Feb 89 23:20:41 GMT
  7. Organization: Wyse Technology, San Jose
  8. Lines: 233
  9. Approved: mikew@wyse.com
  10.  
  11. Submitted-by: Mark Moraes <moraes@csri.toronto.edu>
  12. Posting-number: Volume 3, Issue 10
  13. Archive-name: xplaces.r3/patch1
  14.  
  15.  
  16.  
  17. I fixed xplaces to run properly under R3, with reparenting window
  18. managers, and improved the rcmd script to pass the DISPLAY variable
  19. properly. 
  20.  
  21. (Mike, please could you post this to comp.sources.x - it's for the
  22.  xplaces command that came with R3/contrib/clients, not the one 
  23.  posted recently. Thanks)
  24.  
  25. *** /dev/null    Thu Feb  2 21:21:16 1989
  26. --- patchlevel.h    Thu Feb  2 21:13:04 1989
  27. ***************
  28. *** 0 ****
  29. --- 1 ----
  30. + #define PATCHLEVEL 1
  31. *** /tmp/,RCSt1a20190    Thu Feb  2 21:26:19 1989
  32. --- README    Thu Feb  2 21:16:52 1989
  33. ***************
  34. *** 1,9
  35. ! Ken Yap's original xplaces produced only teh application name, and its
  36. ! geometry. It now gets the WM_COMMAND property and reconstructs the
  37. ! command line with the window's present geometry (rather than the
  38. ! geometry it started with), and also uses the CLIENT_MACHINE property
  39. ! to determine whether the application is running remotely or not. Will
  40. ! only work with reparenting window managers that copy properties to the
  41. ! parent window or non-reparenting window managers.
  42.   
  43.   Mark Moraes
  44.  
  45. --- 1,8 -----
  46. ! Ken Yap's original xplaces produced only the application name, and its
  47. ! geometry. It now gets the WM_COMMAND property and reconstructs the command
  48. ! line with the window's present geometry (rather than the geometry it started
  49. ! with), and also uses the CLIENT_MACHINE property to determine whether the
  50. ! application is running remotely or not.  It should work with reparenting
  51. ! window managers as well - tested with twm.
  52.   
  53.   Mark Moraes
  54. *** /tmp/,RCSt1a20190    Thu Feb  2 21:26:20 1989
  55. --- Imakefile    Thu Feb  2 21:25:51 1989
  56. ***************
  57. *** 1,4
  58.   LOCAL_LIBRARIES = $(XLIB)
  59.   
  60.   SimpleProgramTarget(xplaces)
  61.   
  62.  
  63. --- 1,5 -----
  64.   LOCAL_LIBRARIES = $(XLIB)
  65. + DEFINES = -DRCMD
  66.   
  67.   SimpleProgramTarget(xplaces)
  68.   
  69. *** /tmp/,RCSt1a20190    Thu Feb  2 21:26:23 1989
  70. --- rcmd    Thu Feb  2 20:35:28 1989
  71. ***************
  72. *** 4,9
  73.   # By running this through the Bourne shell at the other end, and
  74.   # we get rid of the rsh and rshd which otherwise hand around at either
  75.   # end. Hacked from a posting by clyde@emx.utexas.edu to list.xpert
  76.   if test $# -lt 2 ; then
  77.       echo Usage: $0 remotehost remotecommand
  78.       exit 1
  79.  
  80. --- 4,10 -----
  81.   # By running this through the Bourne shell at the other end, and
  82.   # we get rid of the rsh and rshd which otherwise hand around at either
  83.   # end. Hacked from a posting by clyde@emx.utexas.edu to list.xpert
  84. + user= 
  85.   if test $# -lt 2 ; then
  86.       echo Usage: $0 remotehost remotecommand
  87.       exit 1
  88. ***************
  89. *** 10,15
  90.   else
  91.       host=$1
  92.       shift
  93.   fi
  94.   echo "TERM=$TERM;export TERM;DISPLAY=$DISPLAY;export DISPLAY;($*)" '\
  95.    > /dev/null 2>&1 &' | rsh $host /bin/sh &
  96.  
  97. --- 11,21 -----
  98.   else
  99.       host=$1
  100.       shift
  101. +     if test $1 = "-l" ; then
  102. +         shift
  103. +         user=$1
  104. +         shift
  105. +     fi
  106.   fi
  107.   xhost=`expr "$DISPLAY" : "\([^:]*\).*"`
  108.   xscreen=`expr "$DISPLAY" : "[^:]*\(.*\)"`
  109. ***************
  110. *** 11,15
  111.       host=$1
  112.       shift
  113.   fi
  114. ! echo "TERM=$TERM;export TERM;DISPLAY=$DISPLAY;export DISPLAY;($*)" '\
  115. !  > /dev/null 2>&1 &' | rsh $host /bin/sh &
  116.  
  117. --- 17,34 -----
  118.           shift
  119.       fi
  120.   fi
  121. ! xhost=`expr "$DISPLAY" : "\([^:]*\).*"`
  122. ! xscreen=`expr "$DISPLAY" : "[^:]*\(.*\)"`
  123. ! if test x$xscreen = x; then
  124. !     xscreen=":0.0"
  125. ! fi
  126. ! if test x$xhost = x -o x$xhost = x"unix"; then
  127. !     DISPLAY=`hostname`$xscreen
  128. ! fi
  129. ! if test x$user = x; then
  130. !     echo "TERM=$TERM;export TERM;DISPLAY=$DISPLAY;export DISPLAY;($*)" '\
  131. !      > /dev/null 2>&1 &' | rsh $host /bin/sh &
  132. ! else
  133. !     echo "TERM=$TERM;export TERM;DISPLAY=$DISPLAY;export DISPLAY;($*)" '\
  134. !      > /dev/null 2>&1 &' | rsh $host -l $user /bin/sh &
  135. ! fi
  136. *** /tmp/,RCSt1a20190    Thu Feb  2 21:26:25 1989
  137. --- xplaces.c    Thu Feb  2 21:12:03 1989
  138. ***************
  139. *** 30,35
  140.       exit(1);
  141.   }
  142.   
  143.   main(argc, argv)
  144.       int        argc;
  145.       char        *argv[];
  146.  
  147. --- 30,36 -----
  148.       exit(1);
  149.   }
  150.   
  151. + static Display    *d;
  152.   main(argc, argv)
  153.       int        argc;
  154.       char        *argv[];
  155. ***************
  156. *** 34,40
  157.       int        argc;
  158.       char        *argv[];
  159.   {
  160. !     register Display    *d;
  161.       register int        width, height;
  162.       int            nchildren;
  163.       char            *win_name;
  164.  
  165. --- 35,48 -----
  166.       int        argc;
  167.       char        *argv[];
  168.   {
  169. !     if ((d = XOpenDisplay(NULL)) == NULL)
  170. !         fatal("Can't open display");
  171. !     searchtree(DefaultRootWindow(d));
  172. ! }
  173. ! searchtree(w)
  174. ! Window w;
  175. ! {
  176.       register int        width, height;
  177.       int            nchildren;
  178.       char            *win_name;
  179. ***************
  180. *** 53,60
  181.       char tmpstr[256];
  182.       int nextarg, donegeometry;
  183.   
  184. -     if ((d = XOpenDisplay(NULL)) == NULL)
  185. -         fatal("Can't open display");
  186.   
  187.       /* get a list of children of the root window */
  188.       if (XQueryTree(d, DefaultRootWindow(d), &root_win, &parent_win,
  189.  
  190. --- 61,66 -----
  191.       char tmpstr[256];
  192.       int nextarg, donegeometry;
  193.   
  194.   
  195.       /* get a list of children of the window */
  196.       if (XQueryTree(d, w, &root_win, &parent_win, &child_list, &nchildren) 
  197. ***************
  198. *** 56,65
  199.       if ((d = XOpenDisplay(NULL)) == NULL)
  200.           fatal("Can't open display");
  201.   
  202. !     /* get a list of children of the root window */
  203. !     if (XQueryTree(d, DefaultRootWindow(d), &root_win, &parent_win,
  204. !         &child_list, &nchildren) == 0)
  205. !         fatal("Can't query window tree");
  206.       /* scan list */
  207.       for ( ; nchildren-- > 0; child_list++)
  208.       {
  209.  
  210. --- 62,71 -----
  211.       int nextarg, donegeometry;
  212.   
  213.   
  214. !     /* get a list of children of the window */
  215. !     if (XQueryTree(d, w, &root_win, &parent_win, &child_list, &nchildren) 
  216. !      == 0)
  217. !         return;
  218.       /* scan list */
  219.       for ( ; nchildren-- > 0; child_list++)
  220.       {
  221. ***************
  222. *** 63,68
  223.       /* scan list */
  224.       for ( ; nchildren-- > 0; child_list++)
  225.       {
  226.           /* what is the name? */
  227.           if (!XFetchName(d, *child_list, &win_name))
  228.               continue;        /* not fatal */
  229.  
  230. --- 69,77 -----
  231.       /* scan list */
  232.       for ( ; nchildren-- > 0; child_list++)
  233.       {
  234. +         /* Recurse first */
  235. +         searchtree(*child_list);
  236.           /* what is the name? */
  237.           if (!XFetchName(d, *child_list, &win_name))
  238.               continue;        /* not fatal */
  239. -- 
  240. Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
  241. Moderator of comp.sources.x
  242.