-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Stop Darktable from crashing when closing secondary darkroom window while window is in fullscreen #18361
Conversation
On macOS, when the secondary darkroom window is closed while it is currently full screened, there are events that are still pending that needs to be consumed. When the window is destroyed by gtk_widget_destroy before consuming all of the unfullscreen event, gtk_main() under dt_gui_gtk_run will throw exc_bad_access exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crash is 100% reproducible on macOS und successfully fixed by this PR.
Is the conditional compilation required or would this work as well (without being needed) on non OSX? It just is easier to have as little conditional compilation as possible. If you accidentally break this code by changing something around it, but you are not compiling on Mac yourself, you'll only find out in CI... If the new code works everywhere without causing problems, I'd prefer a simple comment that it is required for Mac instead of the #ifdef |
@dterrahe Im not sure. Technically it should work without the conditional compilation but I have no way to validate. I only have macOS to compile on |
For me on GNU/Linux when I quit darktable and that the second window is displayed it crashes. Do you also have this on macOS? |
I think I used to get that behaviour. I just tried it again just now and it exits as normal |
Funny enough, when I close the secondary window by clicking the close button, darktable did not crash. Only when I click the "Display a second Darktable" button it crashes |
Let MacOS handle with the fullscreen state change
@stnKrisna : Before merging one question, what is your macOS version? I'd like to have some other macOS dev testing this on different versions. |
@wpferguson : BTW, would be nice if you could also test this on Windows before merging to 5.0.1. TIA. |
No crash on macOS 15.3, darktable with homebrew build. The scenario from the issue desctiption is fixed. I will test on windows as well tomorrow. |
@TurboGit Im on macOS 14.6.1 (23G93) |
fix also works with my darktable-5.0.x bugfix build for macos 15.3 |
No crash on Windows 11 Enterprise with 2 screens. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So all good, thanks all!
…hile window is in fullscreen (#18361) * Consume unfullscreen event when closing secondary window On macOS, when the secondary darkroom window is closed while it is currently full screened, there are events that are still pending that needs to be consumed. When the window is destroyed by gtk_widget_destroy before consuming all of the unfullscreen event, gtk_main() under dt_gui_gtk_run will throw exc_bad_access exception. * Refactor Simplify cleanup so that its all located in _second_window_delete_callback * Let GTK destroy the window Let MacOS handle with the fullscreen state change
#18314
On macOS, when the secondary darkroom window is closed while it is currently full screened, there are events that are still pending that needs to be consumed. When the window is destroyed by
gtk_widget_destroy
before consuming all of the unfullscreen event,gtk_main()
underdt_gui_gtk_run
will throwexc_bad_access
exception.