home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume3 / xprompt / patch1 < prev    next >
Encoding:
Internet Message Format  |  1989-03-20  |  5.0 KB

  1. Path: uunet!wyse!mikew
  2. From: mikew@wyse.wyse.com (Mike Wexler)
  3. Newsgroups: comp.sources.x
  4. Subject: v03i059:  prompting program, Patch1
  5. Message-ID: <2157@wyse.wyse.com>
  6. Date: 20 Mar 89 22:50:29 GMT
  7. Organization: Wyse Technology, San Jose
  8. Lines: 156
  9. Approved: mikew@wyse.com
  10.  
  11. Submitted-by: brachman@cs.ubc.ca
  12. Posting-number: Volume 3, Issue 59
  13. Archive-name: xprompt/patch1
  14.  
  15. diff -cr xprompt.old/patchlevel.h xprompt/patchlevel.h
  16.  
  17. *** xprompt.old/patchlevel.h    Mon Mar 20 14:39:36 1989
  18. --- xprompt/patchlevel.h    Mon Mar 20 14:41:34 1989
  19. ***************
  20. *** 1 ****
  21. ! #define PATCHLEVEL 0
  22. --- 1 ----
  23. ! #define PATCHLEVEL 1
  24. diff -cr xprompt.old/xprompt.c xprompt/xprompt.c
  25. *** xprompt.old/xprompt.c    Mon Mar 20 14:39:36 1989
  26. --- xprompt/xprompt.c    Mon Mar 20 14:39:50 1989
  27. ***************
  28. *** 3,11 ****
  29.   /*
  30.    * xprompt - prompt the user for one or more replies
  31.    *
  32. !  * Written for X11R3
  33. !  * 24-Jan-89 bjb
  34.    *
  35.    * Copyright (C) 1989 Barry Brachman and The University of British Columbia
  36.    *
  37.    * Permission is given to freely copy and distribute this software provided:
  38. --- 3,13 ----
  39.   /*
  40.    * xprompt - prompt the user for one or more replies
  41.    *
  42. !  * 11-Mar-89  Fixed problem with XSetInputFocus being done before windows
  43. !  *            were viewable.
  44.    *
  45. +  * 24-Jan-89  Written for X11R3.  Released for distribution.
  46. +  *
  47.    * Copyright (C) 1989 Barry Brachman and The University of British Columbia
  48.    *
  49.    * Permission is given to freely copy and distribute this software provided:
  50. ***************
  51. *** 39,45 ****
  52.   #include "trexp.h"
  53.   
  54.   #ifndef lint
  55. ! static char *version = "xprompt v1.0 brachman@cs.ubc.ca 14-Feb-89";
  56.   #endif lint
  57.   
  58.   static XrmOptionDescRec table[] = {
  59. --- 41,47 ----
  60.   #include "trexp.h"
  61.   
  62.   #ifndef lint
  63. ! static char *version = "xprompt v1.1 brachman@cs.ubc.ca 11-Mar-89";
  64.   #endif lint
  65.   
  66.   static XrmOptionDescRec table[] = {
  67. ***************
  68. *** 542,563 ****
  69.       /*
  70.        * Handle the grab and/or warp, if necessary
  71.        */
  72. !     if (app_resources.grab) {
  73. !         XGrabKeyboard(XtDisplay(reply_w), XtWindow(reply_w), False,
  74. !             GrabModeAsync, GrabModeAsync, CurrentTime);
  75. !         XSetInputFocus(XtDisplay(reply_w), XtWindow(reply_w),
  76. !                 RevertToPointerRoot, CurrentTime);
  77. !     }
  78. !     if (app_resources.warp) {
  79.           XWindowAttributes reply_w_attr;
  80. -         XEvent event;
  81. -         long em;
  82.   
  83.           if (XGetWindowAttributes(XtDisplay(reply_w), XtWindow(reply_w),
  84.                                    &reply_w_attr) == 0)
  85. !             app_resources.warp = FALSE;
  86. !         else {
  87.               Window root_return, child_return;
  88.               int root_x_return, root_y_return;
  89.               int win_x_return, win_y_return;
  90. --- 544,587 ----
  91.       /*
  92.        * Handle the grab and/or warp, if necessary
  93.        */
  94. !     if (app_resources.grab || app_resources.warp) {
  95.           XWindowAttributes reply_w_attr;
  96.   
  97.           if (XGetWindowAttributes(XtDisplay(reply_w), XtWindow(reply_w),
  98.                                    &reply_w_attr) == 0)
  99. !             app_resources.warp = app_resources.grab = FALSE;
  100. !         else if (!visible) {
  101. !             XEvent event;
  102. !             long em;
  103. !             /*
  104. !              * The following weirdness waits for the windows to become visible
  105. !              * before warping the cursor or setting the input focus.
  106. !              * This is necessary to avoid the cases where a window manager
  107. !              * repositions things *after* the warp has occurred and where the
  108. !              * focus window is not viewable at the time of the XSetInputFocus.
  109. !              * Suggestions on the Right Thing welcome.
  110. !              */
  111. !             em = VisibilityChangeMask;
  112. !             XSelectInput(XtDisplay(popup), XtWindow(popup), em);
  113. !             while (1) {
  114. !                 bzero(&event, sizeof(event));
  115. !                 XNextEvent(XtDisplay(popup), &event);
  116. !                 if (event.type == VisibilityNotify)
  117. !                     break;
  118. !             }
  119. !             em = reply_w_attr.all_event_masks;
  120. !             XSelectInput(XtDisplay(popup), XtWindow(popup), em);
  121. !         }
  122. !         if (app_resources.grab) {
  123. !             XGrabKeyboard(XtDisplay(reply_w), XtWindow(reply_w), False,
  124. !                           GrabModeAsync, GrabModeAsync, CurrentTime);
  125. !             XSetInputFocus(XtDisplay(reply_w), XtWindow(reply_w),
  126. !                            RevertToPointerRoot, CurrentTime);
  127. !         }
  128. !         if (app_resources.warp) {
  129.               Window root_return, child_return;
  130.               int root_x_return, root_y_return;
  131.               int win_x_return, win_y_return;
  132. ***************
  133. *** 581,605 ****
  134.               reply_x = reply_w_attr.width - reply_w_attr.width / 10;
  135.               reply_y = reply_w_attr.height / 2;
  136.   
  137. -             /*
  138. -              * The following weirdness waits for the windows to become visible
  139. -              * before warping the cursor.
  140. -              * This is necessary to avoid the case where a window manager
  141. -              * repositions things *after* the warp has occurred.
  142. -              * Suggestions on the Right Thing welcome.
  143. -              */
  144. -             if (!visible) {
  145. -                 em = VisibilityChangeMask;
  146. -                 XSelectInput(XtDisplay(popup), XtWindow(popup), em);
  147. -                 while (1) {
  148. -                     bzero(&event, sizeof(event));
  149. -                     XNextEvent(XtDisplay(popup), &event);
  150. -                     if (event.type == VisibilityNotify)
  151. -                         break;
  152. -                 }
  153. -                 em = reply_w_attr.all_event_masks;
  154. -                 XSelectInput(XtDisplay(popup), XtWindow(popup), em);
  155. -             }
  156.               XWarpPointer(XtDisplay(reply_w), None, XtWindow(reply_w),
  157.                            0, 0, 0, 0, reply_x, reply_y);
  158.           }
  159. --- 605,610 ----
  160. -- 
  161. Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
  162. Moderator of comp.sources.x
  163.