-
Notifications
You must be signed in to change notification settings - Fork 63
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
pystray run_detached not working on MacOS m2 chip , what is the right way to use to keep program live in background? #138
Comments
import tkinter window = tkinter.Tk() lbl = tkinter.Label(window, text="hello world") lbl.grid(column=0, row=0) def quit_window(icon, item): def show_window(icon, item): def withdraw_window():
window.protocol('WM_DELETE_WINDOW', withdraw_window) |
one finding for the problem is run_detached(), if i use run(), no problem. however I need the program to be kept alive in the background, so I use run_detached() in windows. but it seems not working on mac |
Thank you for your report, and I apologise for this very late response. From the error, I would guess that there may be a bug in the objc or tkinter package on Apple silicon; pystray does not contain any native code, and thus does not manipulate the GIL. I am afraid that I cannot provide any input, as I do not have access to neither the hardware nor macOS. Have you tried updating objc or tkinter? |
@moses-palmer
either run or run_detached wont work on my old macmini but this one works well
|
I am facing a problem when using pystray on MacOS m2 (Ventura 13.2) , It is working fine on windows.
On MacOS, It can minimize to task tray but when click icon to resume back, show the error message below
Fatal Python error: PyEval_RestoreThread: the function must be called with the GIL held, but the GIL is released (the current Python thread state is NULL)
Python runtime state: initialized
Current thread 0x00000001fed50100 (most recent call first):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/init.py", line 1458 in mainloop
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/customtkinter/windows/ctk_tk.py", line 158 in mainloop
File "/Users/dr.inbox/Desktop/AutoOCR_GUI/MAC_Mchip_version/app_mac.py", line 335 in
Extension modules: objc._objc, CoreFoundation._inlines, CoreFoundation._CoreFoundation, Foundation._Foundation, Foundation._inlines, AppKit._inlines, AppKit._AppKit, PIL._imaging, _scproxy, objc._machsignals, PIL._imagingtk (total: 11)
zsh: abort /usr/local/bin/python3
It has nothing wrong with my tkinkter code i think, even with the most simple tkinter example, it is still show error.
The text was updated successfully, but these errors were encountered: