classification
Title: tkinter: XFCE task switcher shows 'Tk' instead of Window title
Type: behavior Stage: resolved
Components: Tkinter Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: epaine, gpolo, mark, serhiy.storchaka, terry.reedy
Priority: normal Keywords:

Created on 2020-09-11 22:42 by mark, last changed 2020-09-13 04:02 by terry.reedy. This issue is now closed.

Messages (5)
msg376745 - (view) Author: Mark Summerfield (mark) * Date: 2020-09-11 22:42
This tiny test application illustrates the problem:
```python
#!/usr/bin/env python3
import tkinter as tk
app = tk.Tk()
app.withdraw()
app.title('Test App')
app.deiconify()
app.mainloop()
```
When run on Linux with XFCE the task bar entry shows the text 'Test App', but the task switcher shows 'Tk' rather than the title text.
msg376794 - (view) Author: Mark Summerfield (mark) * Date: 2020-09-12 08:21
I just ran IDLE and it seems to have the same problem. Although the taskbar entry is 'Python 3.6.9 Shell' (ought really to be 'IDLE'), when context switching the switcher shows the correct icon but the title 'Toplevel'.
msg376795 - (view) Author: Mark Summerfield (mark) * Date: 2020-09-12 08:22
Same applied to IDLE for Python 3.8
msg376801 - (view) Author: E. Paine (epaine) * Date: 2020-09-12 11:28
Thank you for reporting this issue. I wanted to start by pointing out a finer detail: the XFCE program title on the task switcher (the thing you're reporting and I don't have a clue how to describe) is not the same as the default window title (the program title is "Tk" and the default window title is "tk").

Going further, we can show this is not a tkinter issue by running wish and changing the window title (`wm title . {Test App}`). The result is the program title as "Wish" and the subtitle as "Test App". In short, tkinter sits on-top Tcl/Tk and it is quite probable that Tk is the program XFCE *saw* as reponsible for the window. I think its unlikely you could change this without modifying and compiling your own version of Tk (someone please do correct me if I'm wrong).

Again, thank you for reporting this issue, though I think it should be closed.

> the taskbar entry is 'Python 3.6.9 Shell' (ought really to be 'IDLE')

I agree the current title is probably not ideal (there are lots people when first starting who think the IDLE shell *is the* Python shell) though I think we still need the version and word "shell" in it (e.g. "IDLE 3.6.9 Shell"). I personally don't see it as too big an issue, but have nosied Terry in case he wants to add something on this.
msg376820 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-09-13 04:02
The Xfce task switcher appears to be showing the tk widget '_class' option.  When tkinter create a tk widget, it by default sets the 'class' option to the tkinter class name.  This is 'Tk' and 'Toplevel' respectively for the visible windows in the example code and for IDLE. (IDLE withdraws the original root Tk window.) Why Xfce shows the '-class' rather than the title is an issue between tcl/tx, Xfce, and maybe the OS, but should not involve tkinter.  We are not going to change how it sets the 'class' option.  So I am closing this.

I opened issue 41775 for changing the IDLE Shell window title.
History
Date User Action Args
2020-09-13 04:02:33terry.reedysetstatus: open -> closed
resolution: not a bug
messages: + msg376820

stage: resolved
2020-09-12 11:28:37epainesetversions: + Python 3.9, Python 3.10, - Python 3.6
nosy: + terry.reedy, gpolo, serhiy.storchaka, epaine
title: XFCE task switcher shows 'Tk' insteadl of Window title -> tkinter: XFCE task switcher shows 'Tk' instead of Window title
messages: + msg376801

2020-09-12 08:22:34marksetmessages: + msg376795
2020-09-12 08:21:41marksetmessages: + msg376794
2020-09-11 22:42:29markcreate