tkinter window fails to appear approx 10% of the time on MacOS 12.3+

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

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

評価

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

調査の方向性

提供された tkinter の再現プログラムを macOS 12.3.1、Python 3.10.4、tkinter 8.6.12 で繰り返し実行し、Toplevel ウィンドウが表示されるかどうかを観察します。alpha、withdraw、geometry、update_idletasks、mainloop の呼び出し間の相互作用を調査します。報告された環境でウィンドウが断続的に表示されない挙動が再現・説明され、発生しなくなれば完了です。

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

説明

OS-mac topic-tkinter type-bug

Bug report

1 in 10 or 15 windows fails to appear when running tkinter on MacOS version 12.3+ and tkinter 8.6.12 using this simplified program:

import tkinter as tk

hmr = tk.Tk()
hmr.attributes('-alpha', 0)
hmr.withdraw()

root = tk.Toplevel(class_='toplevel')
root.attributes('-alpha', 0)

root.title('My Test Title')

frame = tk.Frame(root)
frame.pack(side=tk.TOP, anchor='nw', padx=0, pady=0, expand=False, fill=tk.NONE)
a = tk.Label(frame, text ="Hello World")
a.pack()

root.update_idletasks()
root.geometry("+600+600")
root.update_idletasks()
root.attributes('-alpha', 1)

root.mainloop()

Your environment

MacOS 12.3.1
Python 3.10.4
tkinter 8.6.12

Background

This problem was first reported to the PySimpleGUI project in mid-May. We've been working to find work-arounds and to narrow down the problem as much as possible. Because tkinter 8.6.11 isn't available pre-built on Python.org for 64 bit Macs, it's not been possible to test to see if 8.6.12 is the origin of the problem. While it is an intermittent problem, it's thankfully frequent enough to make duplication possible by running the program several times manually.

I assume it's an 8.6.12 problem as no one has reported the problem on 8.6.11 on any platform. Numerous MacOS users have been running into the problem.

The example code supplied is the most basic, shortest number of steps we've been able to create that perform the same operations that PySimpleGUI uses to build and move the window.

PySimpleGUI's default location for user windows is the center of the screen. So that users do not see the window "jump" from the starting location, the alpha channel is set to zero when the window is created and remains 0 while it's built and moved. Once moved into the final position, the Alpha channel is set to 1 and thus the window appears in the correct location without a visible jump.

主要言語
Python
スター
77.2k
フォーク
36k
平均マージ
1日 9時間
マージ済み PR(30日)
558

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

python/cpython のほかの issue

python/cpython の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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