Skip to content

gh-152093: Fix test_tk_caret() on macOS#152115

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:tkinter-test-tk-caret-aqua
Jun 24, 2026
Merged

gh-152093: Fix test_tk_caret() on macOS#152115
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:tkinter-test-tk-caret-aqua

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jun 24, 2026

Copy link
Copy Markdown
Member

On macOS the caret position is recorded only while the window is the key (active) window: Tk_SetCaretPos() returns early without updating the display's caret when ![w isKeyWindow] (macosx/tkMacOSXKeyEvent.c). On X11 it is always stored.

In the GHA macOS job the test's window is not the key window, so the set is a no-op and the query reads back the default zeroed position, failing the equality assertion. On Aqua the test now checks only that the query returns the expected keys; the exact round-trip is still verified on the other platforms.

macOS records the caret only for the key window, so the query reads back
zeros instead of the values set in the test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Jun 24, 2026
@serhiy-storchaka serhiy-storchaka merged commit b41dc4a into python:main Jun 24, 2026
54 checks passed
@serhiy-storchaka serhiy-storchaka deleted the tkinter-test-tk-caret-aqua branch June 24, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant