Bug 1740897 [X11] Make parent container of D&D popup transparent to avoid flickering, r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D131252
This commit is contained in:
stransky 2021-11-18 09:44:10 +00:00
Родитель a1427f1f0b
Коммит 664251da5a
1 изменённых файлов: 15 добавлений и 6 удалений

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

@ -5252,13 +5252,22 @@ void nsWindow::ConfigureGdkWindow() {
}
#endif
if (mIsDragPopup && GdkIsWaylandDisplay()) {
GtkWidget* parent = gtk_widget_get_parent(mShell);
if (parent) {
GtkWidgetDisableUpdates(parent);
if (mIsDragPopup) {
if (GdkIsWaylandDisplay()) {
// Disable painting to the widget on Wayland as we paint directly to the
// widget. Wayland compositors does not paint wl_subsurface
// of D&D widget.
if (GtkWidget* parent = gtk_widget_get_parent(mShell)) {
GtkWidgetDisableUpdates(parent);
}
GtkWidgetDisableUpdates(mShell);
GtkWidgetDisableUpdates(GTK_WIDGET(mContainer));
} else {
// Disable rendering of parent container on X11 to avoid flickering.
if (GtkWidget* parent = gtk_widget_get_parent(mShell)) {
gtk_window_set_opacity(GTK_WINDOW(parent), 0.0);
}
}
GtkWidgetDisableUpdates(mShell);
GtkWidgetDisableUpdates(GTK_WIDGET(mContainer));
}
if (mWindowType == eWindowType_popup) {