summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-11-27 22:32:30 +0000
committerMoonchild <moonchild@palemoon.org>2022-11-27 22:32:30 +0000
commitbc165aebf8f5e9396a9ebbe9fe5b2b6b7a56f612 (patch)
tree64c0e329669d5330936e0cba145742fb4489ab09
parent9d0a8340d778264731866b465dbdc5555ea2c86d (diff)
parent058474229dd32f7fb881357f43d7fd2d0c63525b (diff)
downloaduxp-bc165aebf8f5e9396a9ebbe9fe5b2b6b7a56f612.tar.gz
Merge pull request 'Prevent GTK color picker from being frozen when launched from a modal XUL window' (#2037) from FranklinDM/UXP-contrib:work_gtk-color-picker-frozen into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2037
-rw-r--r--widget/gtk/mozgtk/mozgtk.c1
-rw-r--r--widget/gtk/nsColorPicker.cpp9
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);