Replace gtk_dialog_run with async signal handlers (13/20 instances)#719
Draft
Replace gtk_dialog_run with async signal handlers (13/20 instances)#719
Conversation
…logs Co-authored-by: lidaobing <27529+lidaobing@users.noreply.github.com>
Co-authored-by: lidaobing <27529+lidaobing@users.noreply.github.com>
Co-authored-by: lidaobing <27529+lidaobing@users.noreply.github.com>
Co-authored-by: lidaobing <27529+lidaobing@users.noreply.github.com>
Co-authored-by: lidaobing <27529+lidaobing@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove gtk_dialog_run to prevent UI blocking
Replace gtk_dialog_run with async signal handlers (13/20 instances)
Feb 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gtk_dialog_runblocks the UI thread and is removed in GTK4. This PR converts dialog handling to async patterns using GTK signal handlers.Changes
Converted to async (13/20 instances):
pop_info,pop_warning,AboutDialog, error dialogs): Connect response signal togtk_widget_destroy, show dialog non-blockingchoose_file_with_preview,PickEnclosure,OnSaveImage, ShareFile pickers): New*_async()variants acceptstd::function<void(T*)>callbacksShareFile,DataSettings): Response handlers check action (OK/APPLY/CANCEL), destroy or keep open as neededPattern:
Remaining (7/20 instances):
Functions returning values synchronously (
pop_request_quit,pop_obtain_shared_passwd,pop_password_settings,pop_save_path, validation loops inRevisePal,DetectPal). These require API changes at call sites.Technical Details
g_signal_connect_datawith custom data structs for memory management[this]or[=]for context preservation<functional>header to files usingstd::functionOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.