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

[Bug] Event handling is broken on the macOS Sonoma 14.2.1 with tkinter backend #6719

Open
7 of 10 tasks
vkorniienko-logitech opened this issue Mar 21, 2024 · 10 comments
Open
7 of 10 tasks
Labels
Platform Specific Issue - Mac Macs have a multitude of problems when using tkinter Port - TK PySimpleGUI

Comments

@vkorniienko-logitech
Copy link

vkorniienko-logitech commented Mar 21, 2024

Type of Issue Bug


Operating System

macOS Sonoma 14.2.1

PySimpleGUI Port (tkinter, Qt, Wx, Web)


Versions

*** Version information copied to your clipboard. Paste into your GitHub Issue. ***

Python Interpeter: /opt/homebrew/Caskroom/miniconda/base/envs/biquad_designer_env/bin/python
Python version: 3.12.0
Platform: Mac
Platform version: ('14.2.1', ('', '', ''), 'arm64')
Port: PySimpleGUI
tkinter version: 8.6.12
PySimpleGUI version: 5.0.2
PySimpleGUI filename: /opt/homebrew/Caskroom/miniconda/base/envs/biquad_designer_env/lib/python3.12/site-packages/PySimpleGUI/PySimpleGUI.py

Your Experience In Months or Years (optional)

Years Python programming experience

2 years
Years Programming experience overall
6 years
Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)
Qt/QML, Win32API, a few attempts were made to use GTK4

Anything else you think would be helpful?
It seems that there is an existing issue in another project which describes the actual issue. Also, we have the support key assigned, but it's not clear in this issue form where to apply it.


Troubleshooting

These items may solve your problem. Please check those you've done by changing - [ ] to - [X]

  • Searched main docs for your problem PySimpleGUI Documenation
  • Looked for Demo Programs that are similar to your goal. It is recommend you use the Demo Browser! Demo Programs
  • None of your GUI code was generated by an AI algorithm like GPT
  • If not tkinter - looked for Demo Programs for specific port
  • For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.com
  • Have upgraded to the latest release of PySimpleGUI on PyPI (lastest official version)
  • Tried running the Development Build. Your problem may have already been fixed but not released. Check Home Window for release notes and upgrading capability
  • For licensing questions please email license@PySimpleGUI.com

Detailed Description

On the latest macOS version for M1 platform PySimpleGui behaves incorrectly with tkinter backend. There is an existing issue which describes the problem similar to our one:
pure-data/pure-data#2105

The issue is simple. It looks like handling of events is broken either in PySimpleGui or tkinter backend. It's necessary to move the mouse pointer several times around the element for being able to pass a click to it. It seems to be either regression of tkinter or PySimpleGui backend. If any video/whatever help is required we can assist with this as well.

Code To Duplicate

I've tried to use this example:
https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_All_Elements.py

Screenshot, Sketch, or Drawing

image

Extras

Thanks for your handling the bug. Just a small question-where should we put our support code for the faster processing of the issue?


@pysimpleissue pysimpleissue bot closed this as completed Mar 21, 2024
@vkorniienko-logitech vkorniienko-logitech changed the title [ Enhancement/Bug/Question] NOTE - you can also call sg.main() or sg.main_open_github_issue() to post an issue [ Bug] Event handling is broken on the macOS Sonoma 14.2.1 with tkinter backend Mar 21, 2024
@pysimpleissue pysimpleissue bot removed Fill issue form or you will be REJECTED You MUST use the supplied template to submit a request. PySimpleGUI Issues Bot Has Detected an Error labels Mar 21, 2024
@pysimpleissue pysimpleissue bot reopened this Mar 21, 2024
@vkorniienko-logitech vkorniienko-logitech changed the title [ Bug] Event handling is broken on the macOS Sonoma 14.2.1 with tkinter backend [Bug] Event handling is broken on the macOS Sonoma 14.2.1 with tkinter backend Mar 21, 2024
Repository owner deleted a comment from pysimpleissue bot Mar 22, 2024
@PySimpleGUI
Copy link
Owner

PySimpleGUI commented Mar 23, 2024

The support code is part of the GUI built into PySimpleGUI to open issues. I thought it was added to the manual form, but sounds like it may not be so I'll check it. The answer is YES for adding it to your issue.

I see the issue you referenced on the other project closed the issue. I've only just now saw your issue, so I need a bit of time to do research and to pull in our Mac expert.

It would be helpful to see as small of a program as possible that will demonstrate the problem. The "All Elements" example is great to know it happens in, but that particular Demo is huge in that every element is used, it's a window with a timer on the read, etc.

tkinter has had problems with enter/leave/focus starting around 8.6.12. Quite a long time back tooltips had some problems due to tkinter changes.

MacOS, as I'm sure you're aware, is a difficult port for the tkinter project. We've needed to spend a good deal of time and energy working around problems that come up with every new release of the Mac OS. Again, I'm not up to speed yet, but if this is only happening on a specific new version of MacOS, but not anywhere else, then it's something that should be logged with the tkinter team as well since the "Root cause" may not be PySimpleGUI (even if we're the one that needs to add a workaround in the end).

@P-Kaempf
Copy link

P-Kaempf commented May 5, 2024

I have the same issue, MacOS 14.4.1 here. UI elements work once and then become unresponsive until I move the whole window. Movement by one pixel is enough, then the UI becomes responsive again. Until I click on the next UI element. I should be more precise: Repetitive clicks on the same element keep working, but when I switch to a different element, it is unresponsive until I shift the window a bit.

@P-Kaempf
Copy link

P-Kaempf commented May 6, 2024

The issue is resolved with 5.0.4.12! Downloaded the most recent release yesterday and things work perfectly fine with tkinter again!

@P-Kaempf
Copy link

P-Kaempf commented May 6, 2024

Forgot to mention the obvious: You guys are amazing!!!

@PySimpleGUI
Copy link
Owner

The issue is resolved with 5.0.4.12!

How very odd....it must be something that was changed between the releases you've tried. Or, it's intermittent or timing related and we simply got lucky..... for now.....

@PySimpleGUI
Copy link
Owner

I see the issues was opened on 5.0.2.... did anyone try 5.0.3 or 5.0.4?

@kkelly3137
Copy link

Im not up to Ver 5 yet but experiencing somthing similiar on a bunch if Raspberry Pi's with touch screens. I've had complaints from my users but never experienced the issue myself till yesterday.

What I observed was (a screen full 9 buttons ... TKinter indegration) where the TK button animation worked but no event was generated in PSG.

I'm trying to determin if I have bad touch screens or bad code. Having now experienced it I think it's a PSG issue and sounds a lot like the one describe above

@PySimpleGUI
Copy link
Owner

If it's on a Pi, then it's not this issue.

@PySimpleGUI PySimpleGUI added Platform Specific Issue - Mac Macs have a multitude of problems when using tkinter Port - TK PySimpleGUI labels May 8, 2024
@vkorniienko-logitech
Copy link
Author

@PySimpleGUI on the official 5.0.4 version available in pip the issue exists still.

@PySimpleGUI
Copy link
Owner

Thank you @vkorniienko-logitech for the info about 5.0.4. I asked about it a couple of weeks ago and didn't get any replies. You're not seeing the issue on the Maint Releases? 5.0.4.15 is the latest.

I've not been in a hurry to push a maint release to PyPI as I do not see anything in the changes after 5.,0.4 that would impact this problem. That makes it sound potentially timing related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform Specific Issue - Mac Macs have a multitude of problems when using tkinter Port - TK PySimpleGUI
Projects
None yet
Development

No branches or pull requests

4 participants