「view this page in B3 βῆτα server」

Revisions №411

branch: interactive/develop 「№411」
Commited by: Rocco Moretti
GitHub commit link: 「10b07cfdfad6a378」 「№5795」
Difference from previous tested commit:  code diff
Commit date: 2022-02-02 17:10:33

Merge pull request #5795 from RosettaCommons/roccomoretti/interactive_linux_close [Foldit] Fix how Linux reacts to the window close button. Right now, the Foldit linux client is unceremoniously killed when you click the main (OS-generated) "window close" button. (Skipping any "save options" code, and often resulting in a segfault on exit.) The reason for this is that the "official" GLUT specification (apparently) does not have any mechanism for detecting this event and responding properly with cleanup. However, most Linuxes use OpenGLUT or FreeGLUT, which have an extension which is able to handle this (same API for both). This PR adjusts the GLUTWrapper implementation to recognize when we're compiling with OpenGLUT/FreeGLUT, and use that mechanism. This requires a bit of a rework for the on_close functionality, because unlike the Windows or Mac equivalents, the program is getting closed when that box is triggered on Linux, with no mechanism to cancel it. I also adjusted things such that the on_close functionality goes through the same handle_exit() mechanism the rest of the exit button in-game go through. The one exception is when the button is clicked prior to the login screen coming up, where handle_exit() causes crashes due to uninitialized variables, in which case we use the current approach. (You can still get crashes when closing prior to the login screen coming up due to multithreading issues, but those are crashes we already have in the released client.) RELEASE NOTES: Fix how we handle the close window button for Linux clients.

...