macOS "Hide" handled improperly in tkinter with Tk >= 9.0

オープン
#161,848 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
desktop

調査の方向性

Start by tracing how tkinter integrates with Tk on macOS and handles the OS-level Hide command; the report gives a minimal reproduction using tkinter.Tk() and mainloop(). Compare behavior with Tk 8.6 and Tk 9.1 on macOS, then identify the relevant implementation and test locations. Done means Cmd-H or the menu Hide hides the window instead of leaving it visible and unfocused.

索引モデルが issue の本文から書いたものです。

説明

topic-tkinter type-bug
Bug report

Using the macOS OS-level "Hide" feature misbehaves. Rather than hiding the window(s) as expected, tkinter apps are pushed to the background and lose focus to another app. This only seems to happen with Tk >= 9.0; using an older Tk 8.6-based tkinter doesn't have this bug.

This is easy to reproduce. Run the below. It's easiest to test if there's not much clutter on the screen; a simple test case is a terminal to run Python in and clear other apps from the desktop.

import tkinter as tk; r = tk.Tk(); r.mainloop()

After the tkinter window pops up, try to hide (using "Hide" in the menu or Cmd-H). The tkinter app will defocus but remain on-screen, focus will shift to another app (probably the terminal).

❯ python3 --version
Python 3.15.0

>>> import tkinter
>>> tkinter.TkVersion
9.1
CPython versions tested on:

3.15, 3.14, 3.13

Operating systems tested on:

macOS

主要言語
Python
スター
78.2k
フォーク
36.6k
平均マージ
19時間 57分
マージ済み PR(30日)
630

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

python/cpython のほかの issue

python/cpython の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。