Bug 1562141 - [Wayland] Hide/show popup when it's positioned by gdk_window_move_to_rect() and it's visible, r=jhorak

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Martin Stransky 2019-06-28 15:02:11 +00:00
Родитель ccf6a4c660
Коммит 40de4d717b
2 изменённых файлов: 14 добавлений и 0 удалений

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

@ -467,6 +467,7 @@ STUB(gtk_widget_has_grab)
STUB(gtk_widget_hide)
STUB(gtk_widget_is_focus)
STUB(gtk_widget_is_toplevel)
STUB(gtk_widget_is_visible)
STUB(gtk_widget_map)
STUB(gtk_widget_modify_bg)
STUB(gtk_widget_realize)

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

@ -1316,7 +1316,20 @@ void nsWindow::NativeMoveResizeWaylandPopup(GdkPoint* aPosition,
hints = GdkAnchorHints(hints | GDK_ANCHOR_RESIZE);
}
// A workaround for https://gitlab.gnome.org/GNOME/gtk/issues/1986
// gdk_window_move_to_rect() does not reposition visible windows.
bool isWidgetVisible = gtk_widget_is_visible(mShell);
if (isWidgetVisible) {
HideWaylandWindow();
}
sGdkWindowMoveToRect(gdkWindow, &rect, rectAnchor, menuAnchor, hints, 0, 0);
if (isWidgetVisible) {
// We show the popup with the same configuration so no need to call
// ConfigureWaylandPopupWindows() before gtk_widget_show().
gtk_widget_show(mShell);
}
}
void nsWindow::NativeMove() {