Tk Source Code

View Ticket
Login
Ticket UUID: 8b725d6bde21f3e47bcdeb568d6bac1a510e37db
Title: Missing border pixels in alt theme on Windows
Type: Bug Version: all
Submitter: nemethi Created on: 2025-10-27 17:33:53
Subsystem: 88. Themed Tk Assigned To: nemethi
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2025-10-28 13:24:50
Resolution: Fixed Closed By: nemethi
    Closed on: 2025-10-28 13:24:50
Description:

As seen in the upper screenshot (scaled to 400%) within the attached picture alt_win.png, many borders of the alt theme on Windows are incomplete. In this screenshot, the top-right border corners of the following widgets or style elements are missing 2 pixels each: the ttk::menubutton, the slider of the ttk::scale widget, as well as the arrow buttons and the thumb of the ttk::scrollbar.

The reason is that the DrawCorner function of the file generic/ttk/ttkDefaultTheme.c is missing the WIN32_XDRAWLINE_HACK, which is necessary when invoking the XDrawLines function on Windows if the last line is a horizontal or vertical one. The missing code after populating the points array is:

if (corner == 0) {
    points[2].x += WIN32_XDRAWLINE_HACK;
} else {
    points[2].y -= WIN32_XDRAWLINE_HACK;
}

The lower screenshot within the picture alt_win.png shows the result of this patch: Now the above-mentioned borders have the expected appearance.

The Tcl script that generates the GUI shown in the picture alt_win.png is contained in the attached file bordertest.tcl.

User Comments: nemethi (claiming to be Csaba Nemethi) added on 2025-10-28 13:24:50:

Closing the ticket.


nemethi (claiming to be Csaba Nemethi) added on 2025-10-28 13:23:11:

Fixed by commits [6a72f047], [f144f3c3], and [018a6f17].


nemethi (claiming to be Csaba Nemethi) added on 2025-10-27 18:23:54:

Assigned to myself.


nemethi (claiming to be Csaba Nemethi) added on 2025-10-27 18:01:50:

The fix is implemented in the branch "bug-8b725d6bde".


Attachments: