Tk Source Code

Check-in [155ec67d85]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Aug 20.

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

Overview
Comment:Fix [6ca257310a]: wm resizable does not disable single dimension resizing on macOS. Patch from Marc Culler.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-6-branch
Files: files | file ages | folders
SHA3-256:155ec67d85a405deab635c7b4bdef7936898db93f850e0602288283153c5a372
User & Date: fvogel 2018-07-04 07:12:54
Original Comment: Fix [6ca257310a]: wm resizable does not disable single dimension resizing on macOS
Context
2018-07-04
08:40
Fix [1356961b8c]: wm-transient-1.8 fails on macOS. Patch from Marc Culler. check-in: 84303091b1 user: fvogel tags: core-8-6-branch
07:13
Fix [6ca257310a]: wm resizable does not disable single dimension resizing on macOS. Patch from Marc Culler. check-in: 5f6e8877d7 user: fvogel tags: trunk
07:12
Fix [6ca257310a]: wm resizable does not disable single dimension resizing on macOS. Patch from Marc Culler. check-in: 155ec67d85 user: fvogel tags: core-8-6-branch
07:08
Fix [119bb094af]: wm-iconbitmap-1.4 and wm-iconbitmap-2.1 fail on macOS check-in: 514d588f38 user: fvogel tags: core-8-6-branch
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to macosx/tkMacOSXWm.c.

227
228
229
230
231
232
233













234
235
236
237
238
239
240
....
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275




6276
6277
6278
6279
6280
6281
6282
6283
    pointrect.origin = point;
    pointrect.size.width = 0;
    pointrect.size.height = 0;
    return [self convertRectFromScreen:pointrect].origin;
}
#endif














@end

#pragma mark -


/*
 * Forward declarations for procedures defined in this file:
................................................................................
	if ((changedAttributes & (kWindowResizableAttribute |
		kWindowFullZoomAttribute)) || initial) {
	    [macWindow setShowsResizeIndicator:
		    !!(newAttributes & kWindowResizableAttribute)];
	    [[macWindow standardWindowButton:NSWindowZoomButton]
		    setEnabled:(newAttributes & kWindowResizableAttribute) &&
		    (newAttributes & kWindowFullZoomAttribute)];
	    if (newAttributes & kWindowResizableAttribute) {
		wmPtr->flags &= ~(WM_WIDTH_NOT_RESIZABLE |
			WM_HEIGHT_NOT_RESIZABLE);
	    } else {
		wmPtr->flags |= (WM_WIDTH_NOT_RESIZABLE |




			WM_HEIGHT_NOT_RESIZABLE);
	    }
	    WmUpdateGeom(wmPtr, winPtr);
	}
	if ((changedAttributes & kWindowToolbarButtonAttribute) || initial) {
	    [macWindow setShowsToolbarButton:
		    !!(newAttributes & kWindowToolbarButtonAttribute)];
	    if ((newAttributes & kWindowToolbarButtonAttribute) &&







>
>
>
>
>
>
>
>
>
>
>
>
>







 







|
|
<

|
>
>
>
>
|







227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
....
6277
6278
6279
6280
6281
6282
6283
6284
6285

6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
    pointrect.origin = point;
    pointrect.size.width = 0;
    pointrect.size.height = 0;
    return [self convertRectFromScreen:pointrect].origin;
}
#endif

- (NSSize)windowWillResize:(NSWindow *)sender 
                    toSize:(NSSize)frameSize
{
    NSRect currentFrame = [sender frame];
    TkWindow *winPtr = TkMacOSXGetTkWindow(sender);
    if (winPtr->wmInfoPtr->flags & WM_WIDTH_NOT_RESIZABLE) {
	frameSize.width = currentFrame.size.width;
    }
    if (winPtr->wmInfoPtr->flags & WM_HEIGHT_NOT_RESIZABLE) {
	frameSize.height = currentFrame.size.height;
    }
    return frameSize;
}
@end

#pragma mark -


/*
 * Forward declarations for procedures defined in this file:
................................................................................
	if ((changedAttributes & (kWindowResizableAttribute |
		kWindowFullZoomAttribute)) || initial) {
	    [macWindow setShowsResizeIndicator:
		    !!(newAttributes & kWindowResizableAttribute)];
	    [[macWindow standardWindowButton:NSWindowZoomButton]
		    setEnabled:(newAttributes & kWindowResizableAttribute) &&
		    (newAttributes & kWindowFullZoomAttribute)];
	    if (newAttributes & kWindowHorizontalZoomAttribute) {
		wmPtr->flags &= ~(WM_WIDTH_NOT_RESIZABLE);

	    } else {
		wmPtr->flags |= (WM_WIDTH_NOT_RESIZABLE);
	    }
	    if (newAttributes & kWindowVerticalZoomAttribute) {
		wmPtr->flags &= ~(WM_HEIGHT_NOT_RESIZABLE);
	    } else {
		wmPtr->flags |= (WM_HEIGHT_NOT_RESIZABLE);
	    }
	    WmUpdateGeom(wmPtr, winPtr);
	}
	if ((changedAttributes & kWindowToolbarButtonAttribute) || initial) {
	    [macWindow setShowsToolbarButton:
		    !!(newAttributes & kWindowToolbarButtonAttribute)];
	    if ((newAttributes & kWindowToolbarButtonAttribute) &&

Changes to tests/wm.test.

1238
1239
1240
1241
1242
1243
1244
1245
1246


1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
    wm resizable .t bad 0
} -result {expected boolean value but got "bad"}
test wm-resizable-1.5 {usage} -returnCodes error -body {
    wm resizable .t 1 bad
} -result {expected boolean value but got "bad"}

test wm-resizable-2.1 {setting and reading values} {
    wm resizable .t 0 1
    set result [wm resizable .t]


    wm resizable .t 1 0
    lappend result [wm resizable .t]
    wm resizable .t 1 1
    lappend result [wm resizable .t]
} {0 1 {1 0} {1 1}}


### wm sizefrom ###
test wm-sizefrom-1.1 {usage} -returnCodes error -body {
    wm sizefrom
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-sizefrom-1.2 {usage} -returnCodes error -body {







|

>
>




|







1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
    wm resizable .t bad 0
} -result {expected boolean value but got "bad"}
test wm-resizable-1.5 {usage} -returnCodes error -body {
    wm resizable .t 1 bad
} -result {expected boolean value but got "bad"}

test wm-resizable-2.1 {setting and reading values} {
    wm resizable .t 0 0
    set result [wm resizable .t]
    wm resizable .t 0 1
    lappend result [wm resizable .t]
    wm resizable .t 1 0
    lappend result [wm resizable .t]
    wm resizable .t 1 1
    lappend result [wm resizable .t]
} {0 0 {0 1} {1 0} {1 1}}


### wm sizefrom ###
test wm-sizefrom-1.1 {usage} -returnCodes error -body {
    wm sizefrom
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-sizefrom-1.2 {usage} -returnCodes error -body {