All the following problems apply to Linux Mint 21 Cinnamon (based on Ubuntu 22, using the muffin window manager), while everything works flawlessly on Xubuntu 22.

Please, consider the following steps in a Python3 interpreter:

from tkinter import *
root=Tk()

One can then minimize the widget window either by calling root.iconify() or using the window manager's dedicated button for this.

  • Problem #1: root.deiconify() won't bring the window back on the desktop, it stays minimized.
    • A sub-optimal workaround is root.withdraw(); root.deiconify(), but this changes the widgets location on the desktop and also its icon on the taskbar shits to the end.
    • Hint: on Xubuntu, root.iconify() executes in no time, while on LM, root.iconify() is hanging for a few seconds after minimizing the widget as if it was waiting for something?..

If you don't minimize this window, but move another window of whatever application over it, you face...

  • Problem #2: root.lift() won't raise it to the top, it stays hidden under the other window.
    • As a workaround, root.focus_force(); root.lift() does the job, but it steals the focus. root.attributes('-topmost', 1); root.attributes('-topmost', 0) might be a perfect workaround though.

After lifting it, let's say, you want to lower it again...

  • Problem #3: root.lower() won't do anything. Here too, I am only aware of the sub-optimal workaround with root.focus_force(); root.lower(), which leaves the focus on a widget that is not even visible.

  • Problem #4: please, consider the script below:

from tkinter import *

root = Tk()
root.geometry('200x200-0-0')

def func():
    root.geometry('-100-100')
    root.geometry('-0-0')
    print(root.geometry())

b = Button(root, text='push me', command=func)
b.pack()

root.mainloop()

On Cinnamon, the first push on the button makes the whole widget jump around 20 pixels up and left, subsequent clicks on the button don't do anything. Nevertheless, it keep printing 200x200-0-0 even though it's obviously not there. The example works with other coordinates too, it doesn't have to be -0-0. On Xubuntu, the widget stays in the corner as it is supposed to.

I guess this is not an extensive list of similar issues at least with the newest version of python3-tk (3.10.8-1~22.04) on Linux Mint 21 Cinnamon. I wonder where exactly the problems might hide, since none of these issues appear on Xubuntu 22. I would guess, it has to do with the different window managers.

Any insights and workarounds would be very welcome!

0

There are 0 best solutions below