CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

Windows created with customtkinter does not recognize mouse-clicks until it's moved (macOS Sonoma)

Open gernophil opened this issue 1 year ago • 13 comments

Hey everyone, I just updated to Sonoma. I have an app that's build on customtkinter and in general it still works fine. I run the app and after some clicks, the window doesn't recognize mouse-clicks anymore. After I move the window around it works again until after some clicks it stops working again and I have to move the window again. So, in general, everything works, it's just very annoying :). I'll try to reproduce this with the official examples.

gernophil avatar Sep 26 '23 22:09 gernophil

I could reproduce this using the complex_example.py. It seems that sometimes, the window gets responsive again even without moving. However, moving always makes the window responsive again. I made a video of this. You can watch it here (it's too big to upload here): https://1drv.ms/v/s!Alp8Y02f9eFgxJBAT6s1azt8W4InJA

The terminal output of this windows session is:

% python complex_example.py                        
2023-09-27 00:13:06.096 Python[89267:1244083] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
CTkInputDialog: None
CTkInputDialog: None
CTkInputDialog: None
CTkInputDialog: None
CTkInputDialog: 
CTkInputDialog: None
CTkInputDialog: None
CTkInputDialog: None
CTkInputDialog: None
CTkInputDialog: None
2023-09-27 00:14:39.553 defaults[89305:1245642] 
Domain (kCFPreferencesAnyApplication) not found.
Defaults have not been changed.

gernophil avatar Sep 26 '23 22:09 gernophil

I would like to underline the importance of this bug report a little more:

=> It seems that customtkinter is pretty much broken on the latest version of macOS which was officially released yesterday.

If this is true, many apps worldwide will become unusable in the coming weeks once macOS Sonoma is rolled out to more and more systems.

Any idea what might cause the strange behavior shown in the video? Can anybody reproduce this?

(Disclaimer: I’m the original author of the app noScribe that gernophil is porting to macOS. Customtkinter is great and worked perfectly on windows and macOS until now. Thank you very much!)

kaixxx avatar Sep 27 '23 17:09 kaixxx

Update: It seems like moving the window is not necessary. It's enough to just click the top title bar.

gernophil avatar Sep 28 '23 20:09 gernophil

hey mate. i faced the same issue with my app, however i don't use ctk. as i can see, ttk is broken. my app is broken once using ttk.combobox

somejet avatar Sep 28 '23 20:09 somejet

Same problem here with my app which uses ttk

Steffenhir avatar Sep 30 '23 14:09 Steffenhir

I faced the same issue after upgrading to Sonoma 14.0. One out of five times applications with CTK start working after a restart, but after some time the UI elements become unclickable again :(

myasnikv avatar Oct 02 '23 17:10 myasnikv

I did a litte more research. It seems to a problem with the underlying tkinter or even tcl/tk. Here a bugtracker at cpython for this issue: https://github.com/python/cpython/issues/110218

Some people over there report that updating tcl/tk resolves the issue. I cannot test this myself, but it looks promising. Good luck.

kaixxx avatar Oct 04 '23 14:10 kaixxx

Is there even a way to update Tcl/Tk when using the official installers from python.org?

gernophil avatar Oct 11 '23 10:10 gernophil

I see the same problem after upgrading to Sonoma 14. Customtkinter also does not run in python 3.12, which is a separate issue. Presently, operating in Sonoma 14.1, my application must run in python 3.10 using Customtkinter 4.6.3 at max version with the mouse-click problem tolerated by first clicking somewhere in the app window not near a control object. The problem affects at least controls like buttons, check boxes, radio buttons and combo boxes. Combo boxes do open and show item selection changes but the desired item will not be registered.

akseidel avatar Nov 13 '23 15:11 akseidel

As a work around I switched to Python-tk from brew, because there I can update tcl/tk. For Python 3.10 and 3.11 there should be updated installers in December. For Python 3.9 there won't be new installers unfortunately. This is not a problem that can be solved by any Python package, but only by updating tcl/tk (which is bundled with the installers from python.org)

gernophil avatar Nov 13 '23 16:11 gernophil

Facing the same issue here, any updates?

MilkBiscuit avatar Dec 08 '23 07:12 MilkBiscuit

Only thing that works is using a newer version of tcl-tk (see post above). There won't be updates for Python 3.9 from python.org. So, there seems to be no straightforward way other then using brew (or maybe conda).

gernophil avatar Dec 08 '23 07:12 gernophil

Only thing that works is using a newer version of tcl-tk (see post above). There won't be updates for Python 3.9 from python.org. So, there seems to be no straightforward way other then using brew (or maybe conda).

After struggling for 2 hours I managed to upgrade tkinter to '8.6.13' and the issue is gone, thanks!

MilkBiscuit avatar Dec 08 '23 09:12 MilkBiscuit