Tk Source Code

View Ticket
Login
Ticket UUID: 3e3e25f483d63c7698b95ea2dfd49b26090632a
Title: winbutton-1.[12] fails on Win7
Type: Bug Version: core-8-5-branch
Submitter: fvogel Created on: 2016-01-06 09:41:24
Subsystem: 86. Test Tools Assigned To: fvogel
Priority: 6 Severity: Minor
Status: Closed Last Modified: 2016-01-08 14:31:27
Resolution: Fixed Closed By: fvogel
    Closed on: 2016-01-08 14:31:27
Description:
On Win7 (but not on Win Vista):


==== winbutton-1.1 TkpComputeButtonGeometry procedure FAILED
==== Contents of test case:

    deleteWindows
    image create test image1
    image1 changed 0 0 0 0 60 40
    label .b1 -image image1 -bd 4 -padx 0 -pady 2
    button .b2 -image image1 -bd 4 -padx 0 -pady 2
    checkbutton .b3 -image image1 -bd 4 -padx 1 -pady 1 -font {{MS Sans Serif} 8}
    radiobutton .b4 -image image1 -bd 4 -padx 2 -pady 0 -font {{MS Sans Serif} 8}
    pack .b1 .b2 .b3 .b4
    update
    # with patch 463234 with native L&F enabled, this returns:
    # {68 48 70 50 88 50 88 50}
    list [winfo reqwidth .b1] [winfo reqheight .b1]  [winfo reqwidth .b2] [winfo reqheight .b2]  [winfo reqwidth .b3] [winfo reqheight .b3]
 [winfo reqwidth .b4] [winfo reqheight .b4]

---- Result was:
68 48 70 50 91 52 91 52
---- Result should have been (exact matching):
68 48 70 50 90 52 90 52
==== winbutton-1.1 FAILED



==== winbutton-1.2 TkpComputeButtonGeometry procedure FAILED
==== Contents of test case:

    deleteWindows
    label .b1 -bitmap question -bd 3 -padx 0 -pady 2
    button .b2 -bitmap question -bd 3 -padx 0 -pady 2
    checkbutton .b3 -bitmap question -bd 3 -padx 1 -pady 1 -font {{MS Sans Serif} 8}
    radiobutton .b4 -bitmap question -bd 3 -padx 2 -pady 0 -font {{MS Sans Serif} 8}
    pack .b1 .b2 .b3 .b4
    update
    # with patch 463234 with native L&F enabled, this returns:
    # {23 33 25 35 43 35 43 35}
    list [winfo reqwidth .b1] [winfo reqheight .b1]  [winfo reqwidth .b2] [winfo reqheight .b2]  [winfo reqwidth .b3] [winfo reqheight .b3]
 [winfo reqwidth .b4] [winfo reqheight .b4]

---- Result was:
23 33 25 35 46 37 46 37
---- Result should have been (exact matching):
23 33 25 35 45 37 45 37
==== winbutton-1.2 FAILED
User Comments: fvogel added on 2016-01-08 14:31:27:
Merged (by Jan Nijtmans) to trunk, and cherrypicked to core-8-5-branch.

fvogel added on 2016-01-06 13:42:20:

This is due to a specific Win7 feature, which has a bug.

In short: My Win7 system first started at 125% DPI because it is fitted with a high resolution monitor. This causes Win7 to prevent access to the smallest size of some fonts, in particular:

font actual {{MS Sans Serif} 8} states 10 (instead of 8) in -size

The bug in Win7 is that even after having instructed Windows7 to revert to 100%DPI (which I did long time ago), the smallest of the sizes of these some fonts still does not become available to the poor user.

On has to manually change three key values in the registry to fix this.

See details here: FULL STORY (at answers.microsoft.com)

After doing the changes in the registry, the tests pass for me.

Regarding the Tk side, to avoid the issue in the future on other machines I suggest flagging these two tests as "nonPortable" since they depend on a specific Windows7 registry setting.

See branch bug-3e3e25f483


fvogel added on 2016-01-06 09:42:11:

Reverting [c6e71a76f7] makes the issue disappear.