Tk Source Code

View Ticket
Login
2026-11-13
12:57 • Closed ticket [3598564f]: wm maxsize does not take into account task bar on Windows plus 11 other changes artifact: 4e4f859c user: nemethi
12:48
Fix for [3598564fff]: wm maxsize does not take into account task bar on Windows check-in: 7c447165 user: csaba tags: core-8-6-branch
11:41
Fix for [3598564fff]: wm maxsize does not take into account task bar on Windows check-in: d00d9c55 user: csaba tags: core-9-0-branch
2026-11-12
19:16
Fix for [3598564fff]: wm maxsize does not take into account task bar on Windows check-in: da6ce0c6 user: csaba tags: trunk, main
2026-11-05
14:58
Fix [3598564fff]: the default maximum size of a toplevel did not take into account the taskbar or panels, so a window whose natural size was larger than the screen extended under them. The default maximum size is now that of the work area, less the decorations of the window: of the monitor on Windows, from _NET_WORKAREA on X11, and the visible frame on macOS as before. On X11 the size of the decorations is used once it is known, instead of a fixed guess, and the natural size is recomputed when it changes. On X11 and macOS the natural size is now limited by the default maximum size, as it was on Windows. On X11 a toplevel is placed below the menubar also when the menubar height changes but the size of the wrapper does not. Tests wm-maxsize-2.6 and 2.7. Rebased on main. check-in: 7ab79e1a user: serhiy.storchaka tags: default-maxsize-workarea
14:32 • Ticket [3598564f] wm maxsize does not take into account task bar on Windows 7 status still Open with 3 other changes artifact: 5e81830f user: serhiy.storchaka
14:28
Fix [3598564fff]: the default maximum size of a toplevel did not take into account the taskbar or panels, so a window whose natural size was larger than the screen extended under them. The default maximum size is now that of the work area, less the decorations of the window: of the monitor on Windows, from _NET_WORKAREA on X11, and the visible frame on macOS as before. On X11 the size of the decorations is used once it is known, instead of a fixed guess, and the natural size is recomputed when it changes. On X11 and macOS the natural size is now limited by the default maximum size, as it was on Windows. On X11 a toplevel is placed below the menubar also when the menubar height changes but the size of the wrapper does not. Tests wm-maxsize-2.6 and 2.7. check-in: 9daa5310 user: serhiy.storchaka tags: default-maxsize-workarea
2012-12-27
05:59 • Ticket [3598564f] wm maxsize does not take into account task bar on Windows 7 status still Open with 4 other changes artifact: 068cf080 user: nalimilan
05:59 • Add attachment window under taskbar example.jpg to ticket [3598564f] artifact: 54551bea user: nalimilan
2012-12-26
22:59 • New ticket [3598564f] wm maxsize does not take into account task bar on Windows 7. artifact: f20c582b user: nalimilan

Ticket UUID: 3598564
Title: wm maxsize does not take into account task bar on Windows
Type: Bug Version: current: 8.6.0
Submitter: nalimilan Created on: 2012-12-26 22:59:06
Subsystem: 62. Geometry Functions Assigned To: aku
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2026-11-13 12:57:59
Resolution: Fixed Closed By: nemethi
    Closed on: 2026-11-13 12:57:59
Description:
On my Windows 7 box with a 768px screen, wm maxsize returns 750. This does not take into account the size of the task bar, which means that natural height of windows can be more than the \"usable\" screen height, making the window appear _behind_ the task bar (see screenshot).

This problem is visible e.g. when one widget has a fixed height, but the one stacked below it does not. In that case, the window\'s natural size should be limited to the usable screen size so that it stops right above the task bar. What happens at the moment is that the second widget, which has no fixed size, only shrinks when the window would exceed the value of \"wm maxsize\". This example (used in the screenshot) illustrates the problem:
toplevel .w
text .w.t1 -height 25
text .w.t2
grid .w.t1
grid .w.t2
update
wm geometry .w
wm maxsize .w

(Just change \"-height 25\" so that the first text box takes the most part of your screen\'s height.)


This problem also happened with Tk 8.5. I have not tested this under Windows 7 SP1 (upgrade bug).
User Comments: nemethi (claiming to be Csaba Nemethi) added on 2026-11-13 12:57:59:

Serhiy, many thanks! Merged into main, core-9-0-branch, and core-8-6-branch by commits [da6ce0c6], [d00d9c55], and [7c447165].


serhiy.storchaka added on 2026-11-05 14:32:16:

Still reproducible on Windows 11: the window extends under the taskbar and past the bottom of the screen. X11 has the same problem: the default maximum size is the size of the display less fixed 15 and 30 pixels for the decorations, which are wrong for most modern window managers, and Tk did not limit the natural size of a window by it at all.

Fixed on branch default-maxsize-workarea: the default wm maxsize is the work area less the actual decorations of the window, that of the monitor on Windows and _NET_WORKAREA on X11, and the natural size of a toplevel is limited by it. On macOS the default maximum size already excluded the menu bar and the Dock; the natural size of a toplevel is now limited by it too. This is not tested on macOS.


nalimilan added on 2012-12-27 05:59:10:

File Added - 458416: window under taskbar example.jpg

Attachments: