diff options
author | FranklinDM <mrmineshafter17@gmail.com> | 2022-07-28 23:46:27 +0800 |
---|---|---|
committer | FranklinDM <mrmineshafter17@gmail.com> | 2022-11-24 21:54:22 +0800 |
commit | 058474229dd32f7fb881357f43d7fd2d0c63525b (patch) | |
tree | 539387190803fc8009f0482440b6733656c40f89 /widget | |
parent | eb87672d4cdd5a0030ff2a639b01068e89b99b87 (diff) | |
download | uxp-058474229dd32f7fb881357f43d7fd2d0c63525b.tar.gz |
Issue #2036 - Prevent GTK color picker from being frozen when launched from a modal XUL window
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1496836
Diffstat (limited to 'widget')
-rw-r--r-- | widget/gtk/mozgtk/mozgtk.c | 1 | ||||
-rw-r--r-- | widget/gtk/nsColorPicker.cpp | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/widget/gtk/mozgtk/mozgtk.c b/widget/gtk/mozgtk/mozgtk.c index d0b87613b1..dd6260b78d 100644 --- a/widget/gtk/mozgtk/mozgtk.c +++ b/widget/gtk/mozgtk/mozgtk.c @@ -478,6 +478,7 @@ STUB(gtk_widget_unparent) STUB(gtk_window_deiconify) STUB(gtk_window_fullscreen) STUB(gtk_window_get_group) +STUB(gtk_window_get_modal) STUB(gtk_window_get_transient_for) STUB(gtk_window_get_type) STUB(gtk_window_get_type_hint) diff --git a/widget/gtk/nsColorPicker.cpp b/widget/gtk/nsColorPicker.cpp index 93ab8bb9ad..da158230ac 100644 --- a/widget/gtk/nsColorPicker.cpp +++ b/widget/gtk/nsColorPicker.cpp @@ -100,7 +100,11 @@ NS_IMETHODIMP nsColorPicker::Open(nsIColorPickerShownCallback *aColorPickerShown GtkWidget* color_chooser = gtk_color_chooser_dialog_new(title, parent_window); if (parent_window) { - gtk_window_set_destroy_with_parent(GTK_WINDOW(color_chooser), TRUE); + GtkWindow *window = GTK_WINDOW(color_chooser); + gtk_window_set_destroy_with_parent(window, TRUE); + if (gtk_window_get_modal(parent_window)) { + gtk_window_set_modal(window, TRUE); + } } gtk_color_chooser_set_use_alpha(GTK_COLOR_CHOOSER(color_chooser), FALSE); @@ -117,6 +121,9 @@ NS_IMETHODIMP nsColorPicker::Open(nsIColorPickerShownCallback *aColorPickerShown GtkWindow *window = GTK_WINDOW(color_chooser); gtk_window_set_transient_for(window, parent_window); gtk_window_set_destroy_with_parent(window, TRUE); + if (gtk_window_get_modal(parent_window)) { + gtk_window_set_modal(window, TRUE); + } } GdkColor color_gdk = convertToGdkColor(color); |