I could not find any documentation on this subject, so any help would be appreciated.
Is there any from within my Windows application to be notified of when my application is about to closed when X11 is shutdown? More specifically when I run my app via wine on OSX, the common way to shutdown the app is via command key + Q. This quits X11 as well as my app. I would however like the opportunity save the users current session. As of right now my app quits and all work done is lost.
Notification of quit event
You cannot really set up CMD+Q to just quit the program in Wine, because of how it has to run in X11 and X11 runs on top of OSX.... unless you want to customize your own X11 source code and build your own version... its possible, but not with normal X11 or XQuartz.
Make sure you have X11 set to prompt when you hit CMD+Q and it'll come up with a warning... it won't save your stuff, but it'll prevent it from closing down without confirmation.
Other than that.. don't hit CMD+Q....
Make sure you have X11 set to prompt when you hit CMD+Q and it'll come up with a warning... it won't save your stuff, but it'll prevent it from closing down without confirmation.
Other than that.. don't hit CMD+Q....
Both Apple's X11 and XQuartz will prompt you with a "Are you sure you want to quit now?" message if there are active clients open (actually, I don't completely remember about X11, but I'm sure XQuartz does this) unless you intentionally disabled this function using a terminal command such as:
If there are no clients open (ie, no connections to the X server) Cmd-Q will quit immediately. If clients are open, and the default behavior is intact, you should get a warning. So if you get a warning message, don't click "Ok" because something will get ungraciously killed.
Code: Select all
defaults write org.x.x11 no_quit_alert true