Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gernophil opened this issue Sep 26, 2023 · 13 comments

Comments

@gernophil
Copy link

gernophil commented Sep 26, 2023

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
Copy link
Author

gernophil commented Sep 26, 2023

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.

@kaixxx
Copy link

kaixxx commented Sep 27, 2023

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!)

@gernophil
Copy link
Author

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

@somejet
Copy link

somejet commented Sep 28, 2023

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

@Steffenhir
Copy link

Same problem here with my app which uses ttk

@myasnikv
Copy link

myasnikv commented Oct 2, 2023

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 :(

@kaixxx
Copy link

kaixxx commented Oct 4, 2023

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: python/cpython#110218

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

@gernophil
Copy link
Author

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

@akseidel
Copy link

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.

@gernophil
Copy link
Author

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)

@MilkBiscuit
Copy link

Facing the same issue here, any updates?

@gernophil
Copy link
Author

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).

@MilkBiscuit
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants