Bug 1496836 - Set colorpicker widget as modal if parent widget is also modal on GTK. r=karlt

Differential Revision: https://phabricator.services.mozilla.com/D8199

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tim Nguyen 2018-10-10 20:21:39 +00:00
Родитель 6fcac07b5e
Коммит 446b765bc6
2 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -495,6 +495,7 @@ STUB(gtk_widget_unrealize)
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)

Просмотреть файл

@ -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);