Skip to content

Commit cea9590

Browse files
committed
Fix pulse-and-reappear quit bug on macOS
Force a clean process exit when the user clicks close. Works around a pywebview 6.2 + macOS 26 Tahoe interaction where the first close click would only flash the window instead of fully quitting. The closing event now calls os._exit(0) directly.
1 parent e2d64ef commit cea9590

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

peanut_desktop.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,16 @@ def run_server():
201201
# webview.start() blocks until the window closes. confirm_close=False
202202
# means closing the window quits immediately. When this returns,
203203
# server_thread (daemon) dies with the main thread.
204+
# Force a clean exit when the user clicks the close button.
205+
# Works around a macOS Tahoe + pywebview 6.2 quirk where the first
206+
# close click only "pulses" the window instead of fully quitting.
207+
# os._exit() bypasses any pywebview/macOS reload logic.
208+
window.events.closing += lambda: os._exit(0)
209+
204210
webview.start(debug=False)
205211

206212

207213
if __name__ == "__main__":
208214
main()
209215

210216

211-
212-
if __name__ == "__main__":
213-
main()

0 commit comments

Comments
 (0)