Tk Source Code

Check-in [3752da0337]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Synchronize the resizing flags and attributes so wm resizable reports values correctly.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug-6ca257310a
Files: files | file ages | folders
SHA3-256:3752da033789be260bb489fc2931cb66ff25128e33673a2b343288a535513bc2
User & Date: culler 2018-06-30 13:48:38
References
2018-06-30
13:52 Ticket [6ca257310a] resizable() does not disable single dimension resizing status still Open with 4 other changes artifact: f27fb95490 user: marc_culler
Context
2018-06-30
14:30
Complete test wm-resizable-2.1 with the fourth combination case Closed-Leaf check-in: 32b9c8fee0 user: fvogel tags: bug-6ca257310a
13:48
Synchronize the resizing flags and attributes so wm resizable reports values correctly. check-in: 3752da0337 user: culler tags: bug-6ca257310a
2018-06-29
21:39
Fix bug [6ca257310a]: add implementation of [TkWindow windowWillResize]. check-in: c3fd47a7fd user: culler tags: bug-6ca257310a
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to macosx/tkMacOSXWm.c.

   232    232   #endif
   233    233   
   234    234   - (NSSize)windowWillResize:(NSWindow *)sender 
   235    235                       toSize:(NSSize)frameSize
   236    236   {
   237    237       NSRect currentFrame = [sender frame];
   238    238       TkWindow *winPtr = TkMacOSXGetTkWindow(sender);
   239         -    if (!(winPtr->wmInfoPtr->attributes & kWindowHorizontalZoomAttribute)) {
          239  +    if (winPtr->wmInfoPtr->flags & WM_WIDTH_NOT_RESIZABLE) {
   240    240   	frameSize.width = currentFrame.size.width;
   241    241       }
   242         -    if (!(winPtr->wmInfoPtr->attributes & kWindowVerticalZoomAttribute)) {
          242  +    if (winPtr->wmInfoPtr->flags & WM_HEIGHT_NOT_RESIZABLE) {
   243    243   	frameSize.height = currentFrame.size.height;
   244    244       }
   245    245       return frameSize;
   246    246   }
   247    247   @end
   248    248   
   249    249   #pragma mark -
................................................................................
  6277   6277   	if ((changedAttributes & (kWindowResizableAttribute |
  6278   6278   		kWindowFullZoomAttribute)) || initial) {
  6279   6279   	    [macWindow setShowsResizeIndicator:
  6280   6280   		    !!(newAttributes & kWindowResizableAttribute)];
  6281   6281   	    [[macWindow standardWindowButton:NSWindowZoomButton]
  6282   6282   		    setEnabled:(newAttributes & kWindowResizableAttribute) &&
  6283   6283   		    (newAttributes & kWindowFullZoomAttribute)];
  6284         -	    if (newAttributes & kWindowResizableAttribute) {
  6285         -		wmPtr->flags &= ~(WM_WIDTH_NOT_RESIZABLE |
  6286         -			WM_HEIGHT_NOT_RESIZABLE);
         6284  +	    if (newAttributes & kWindowHorizontalZoomAttribute) {
         6285  +		wmPtr->flags &= ~(WM_WIDTH_NOT_RESIZABLE);
         6286  +	    } else {
         6287  +		wmPtr->flags |= (WM_WIDTH_NOT_RESIZABLE);
         6288  +	    }
         6289  +	    if (newAttributes & kWindowVerticalZoomAttribute) {
         6290  +		wmPtr->flags &= ~(WM_HEIGHT_NOT_RESIZABLE);
  6287   6291   	    } else {
  6288         -		wmPtr->flags |= (WM_WIDTH_NOT_RESIZABLE |
  6289         -			WM_HEIGHT_NOT_RESIZABLE);
         6292  +		wmPtr->flags |= (WM_HEIGHT_NOT_RESIZABLE);
  6290   6293   	    }
  6291   6294   	    WmUpdateGeom(wmPtr, winPtr);
  6292   6295   	}
  6293   6296   	if ((changedAttributes & kWindowToolbarButtonAttribute) || initial) {
  6294   6297   	    [macWindow setShowsToolbarButton:
  6295   6298   		    !!(newAttributes & kWindowToolbarButtonAttribute)];
  6296   6299   	    if ((newAttributes & kWindowToolbarButtonAttribute) &&