mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
Change preferences sub-dialogs to be modal
This solves the issue where the parent dialog is closed and then the child dialog is used. This is however only a partial fix: - Many other dialogs throughout the codebase do not currently have parent windows and need to be refactored. - Not all window managers respect modal so users can still trigger bugs. We can be more defensive against this but it requires more refactoring. Closes #2686
This commit is contained in:
@@ -190,7 +190,7 @@ gtkutil_file_req_response (GtkWidget *dialog, gint res, struct file_req *freq)
|
||||
}
|
||||
|
||||
void
|
||||
gtkutil_file_req (const char *title, void *callback, void *userdata, char *filter, char *extensions,
|
||||
gtkutil_file_req (GtkWindow *parent, const char *title, void *callback, void *userdata, char *filter, char *extensions,
|
||||
int flags)
|
||||
{
|
||||
struct file_req *freq;
|
||||
@@ -269,6 +269,16 @@ gtkutil_file_req (const char *title, void *callback, void *userdata, char *filte
|
||||
G_CALLBACK (gtkutil_file_req_response), freq);
|
||||
g_signal_connect (G_OBJECT (dialog), "destroy",
|
||||
G_CALLBACK (gtkutil_file_req_destroy), (gpointer) freq);
|
||||
|
||||
if (parent)
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
|
||||
|
||||
if (flags & FRF_MODAL)
|
||||
{
|
||||
g_assert (parent);
|
||||
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
|
||||
}
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user