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.