Tk Source Code

View Ticket
Login
Ticket UUID: 1410560bc7a35fc7c4e72bb4a1c5ecf296d8874a
Title: Aqua: avoid fullscreen toplevel leaving an empty region after resolution change
Type: Patch Version: 8.6.13
Submitter: chrstphrchvz Created on: 2023-04-08 19:28:17
Subsystem: 66. Aqua Window Operations Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2026-10-27 13:47:28
Resolution: None Closed By: nobody
    Closed on:
Description:

Something I encountered while revisiting [8405344968] (which may be outdated) and attempting to reproduce https://github.com/python/cpython/issues/85521 (which I am not sure clearly describes a single issue).

In ApplyWindowAttributeFlagChanges() (tkMacOSXWm.c) since [cd5f55d9881a]:

		    /*
		     * The default max size has height less than the screen
		     * height. This causes the window manager to refuse to
		     * allow the window to be resized when it is a split
		     * window. To work around this we make the max size equal
		     * to the screen size.  (For 10.11 and up, only)
		     */
if ([NSApp macOSVersion] >= 101100) { NSSize screenSize = [[macWindow screen] frame].size; [macWindow setMaxFullScreenContentSize:screenSize]; }

Setting maxFullScreenContentSize to the current screen resolution is undesirable. I observe on macOS 12.6.4 Monterey (Intel) that if a toplevel is fullscreen, and either the screen resolution (measured in logical pixels rather than physical pixels) increases or the fullscreen space for the toplevel is moved to a higher resolution screen (e.g. using Mission Control), then AppKit resizes the (TKWindow *) with the width and height limited by maxFullScreenContentSize as when ApplyWindowAttributeFlagChanges() was most recently called, leaving a black region below and/or to the right of the toplevel. I do not observe this issue on macOS 10.13 High Sierra, though.

Setting maxFullScreenContentSize to something much larger, e.g. NSMakeSize(FLT_MAX, FLT_MAX) (mentioned in the documentation for the maxSize property), avoids this problem. See attached patch.

User Comments: chrstphrchvz added on 2026-10-27 13:47:28:
Patch was committed to branch bug-1410560b.

chrstphrchvz added on 2023-04-09 19:50:09:

Here is a screen recording showing the issue for a fullscreen toplevel moved from one display to another with higher resolution: https://vimeo.com/816056513


Attachments: