home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / tcl / 2213 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  4.5 KB

  1. Path: sparky!uunet!olivea!spool.mu.edu!agate!sprite.Berkeley.EDU!ouster
  2. From: ouster@sprite.Berkeley.EDU (John Ousterhout)
  3. Newsgroups: comp.lang.tcl
  4. Subject: Re: Tk3.0 bug?
  5. Message-ID: <1h7hh6INNrlk@agate.berkeley.edu>
  6. Date: 22 Dec 92 16:59:18 GMT
  7. References: <SLS.92Dec18163617@batcomputer.aero.org> <1h56dpINNfvt@agate.berkeley.edu> <1992Dec22.012721.17612@walter.bellcore.com>
  8. Organization: U.C. Berkeley Sprite Project
  9. Lines: 146
  10. NNTP-Posting-Host: tyranny.berkeley.edu
  11.  
  12. Mea culpa.  When I posted a patch yesterday for the bug whereby
  13. "wm withdraw" didn't work correctly, I forgot that I've made
  14. several changes to tkWm.c since the release, and I didn't get them
  15. all in the patch.  Here's a better tkWm.c patch:
  16.  
  17. *** /tmp/,RCSt1084828    Tue Dec 22 08:57:35 1992
  18. --- tkWm.c    Mon Dec 21 11:43:16 1992
  19. ***************
  20. *** 206,211 ****
  21. --- 206,214 ----
  22.    * WM_VROOT_OFFSET_STALE -    non-zero means that (x,y) offset information
  23.    *                about the virtual root window is stale and
  24.    *                needs to be fetched fresh from the X server.
  25. +  * WM_ABOUT_TO_MAP -        non-zero means that the window is about to
  26. +  *                be mapped by TkWmMapWindow.  This is used
  27. +  *                by UpdateGeometryInfo to modify its behavior.
  28.    */
  29.   
  30.   #define WM_NEVER_MAPPED        1
  31. ***************
  32. *** 215,220 ****
  33. --- 218,224 ----
  34.   #define WM_UPDATE_SIZE_HINTS    0x10
  35.   #define WM_SYNC_PENDING        0x20
  36.   #define WM_VROOT_OFFSET_STALE    0x40
  37. + #define WM_ABOUT_TO_MAP        0x100
  38.   
  39.   /*
  40.    * This module keeps a list of all top-level windows, primarily to
  41. ***************
  42. *** 382,391 ****
  43.       XTextProperty textProp;
  44.       int savedX, savedY, savedFlags;
  45.   
  46. -     if (wmPtr->hints.initial_state == WithdrawnState) {
  47. -     return;
  48. -     }
  49.       if (wmPtr->flags & WM_NEVER_MAPPED) {
  50.       /*
  51.        * This is the first time this window has ever been mapped.
  52.        * Store all the window-manager-related information for the
  53. --- 386,394 ----
  54.       XTextProperty textProp;
  55.       int savedX, savedY, savedFlags;
  56.   
  57.       if (wmPtr->flags & WM_NEVER_MAPPED) {
  58. +     wmPtr->flags &= ~WM_NEVER_MAPPED;
  59.       /*
  60.        * This is the first time this window has ever been mapped.
  61.        * Store all the window-manager-related information for the
  62. ***************
  63. *** 427,433 ****
  64. --- 430,441 ----
  65.           }
  66.       }
  67.       }
  68. +     if (wmPtr->hints.initial_state == WithdrawnState) {
  69. +     return;
  70. +     }
  71. +     wmPtr->flags |= WM_ABOUT_TO_MAP;
  72.       UpdateGeometryInfo((ClientData) winPtr);
  73. +     wmPtr->flags &= ~WM_ABOUT_TO_MAP;
  74.   
  75.       /*
  76.        * Map the window, wait to be sure that the window manager has
  77. ***************
  78. *** 435,441 ****
  79.        * if there were explicit positions asked for.
  80.        */
  81.   
  82. -     wmPtr->flags &= ~WM_NEVER_MAPPED;
  83.       XMapWindow(winPtr->display, winPtr->window);
  84.       savedX = wmPtr->x;
  85.       savedY = wmPtr->y;
  86. --- 443,448 ----
  87. ***************
  88. *** 585,590 ****
  89. --- 592,603 ----
  90.       char c;
  91.       int length;
  92.   
  93. +     if (argc < 2) {
  94. +     wrongNumArgs:
  95. +     Tcl_AppendResult(interp, "wrong # args: should be \"",
  96. +         argv[0], " option window ?arg ...?\"", (char *) NULL);
  97. +     return TCL_ERROR;
  98. +     }
  99.       c = argv[1][0];
  100.       length = strlen(argv[1]);
  101.       if ((c == 't') && (strncmp(argv[1], "tracing", length) == 0)
  102. ***************
  103. *** 602,610 ****
  104.       }
  105.   
  106.       if (argc < 3) {
  107. !     Tcl_AppendResult(interp, "wrong # args: should be \"",
  108. !         argv[0], " option window ?arg ...?\"", (char *) NULL);
  109. !     return TCL_ERROR;
  110.       }
  111.       winPtr = (TkWindow *) Tk_NameToWindow(interp, argv[2], tkwin);
  112.       if (winPtr == NULL) {
  113. --- 615,621 ----
  114.       }
  115.   
  116.       if (argc < 3) {
  117. !     goto wrongNumArgs;
  118.       }
  119.       winPtr = (TkWindow *) Tk_NameToWindow(interp, argv[2], tkwin);
  120.       if (winPtr == NULL) {
  121. ***************
  122. *** 1235,1243 ****
  123.           wmPtr->protPtr = protPtr;
  124.           protPtr->interp = interp;
  125.           strcpy(protPtr->command, argv[4]);
  126. -         if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
  127. -         UpdateWmProtocols(wmPtr);
  128. -         }
  129.       }
  130.       if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
  131.           UpdateWmProtocols(wmPtr);
  132. --- 1246,1251 ----
  133. ***************
  134. *** 1970,1976 ****
  135.       return;
  136.       }
  137.   
  138. !     if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
  139.       int savedX, savedY, savedFlags;
  140.   
  141.       savedX = wmPtr->x;
  142. --- 1978,1991 ----
  143.       return;
  144.       }
  145.   
  146. !     /*
  147. !      * Wait for the configure operation to complete, then verify that the
  148. !      * window was positioned where it was supposed to be and adjust it if
  149. !      * it wasn't.  Don't need to do this, however, if the window is about
  150. !      * to be mapped:  it will be taken care of elsewhere.
  151. !      */
  152. !     if (!(wmPtr->flags & WM_ABOUT_TO_MAP)) {
  153.       int savedX, savedY, savedFlags;
  154.   
  155.       savedX = wmPtr->x;
  156.