Bug 1555866 - [Wayland] Don't position windows with zero height/width, r=jhorak

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Martin Stransky 2019-06-03 14:27:29 +00:00
Родитель 2b5a2efa96
Коммит 73126f44cc
1 изменённых файлов: 7 добавлений и 2 удалений

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

@ -1256,6 +1256,12 @@ void nsWindow::NativeMoveResizeWaylandPopup(GdkPoint* aPosition,
GdkWindow*, const GdkRectangle*, GdkGravity, GdkGravity, GdkAnchorHints,
gint, gint))dlsym(RTLD_DEFAULT, "gdk_window_move_to_rect");
// Compositor may be confused by windows with width/height = 0
// and positioning such windows leads to Bug 1555866.
if (!AreBoundsSane()) {
return;
}
if (aSize) {
gtk_window_resize(GTK_WINDOW(mShell), aSize->width, aSize->height);
}
@ -1265,8 +1271,7 @@ void nsWindow::NativeMoveResizeWaylandPopup(GdkPoint* aPosition,
// Use standard gtk_window_move() instead of gdk_window_move_to_rect() when:
// - gdk_window_move_to_rect() is not available
// - the widget doesn't have a valid GdkWindow
// - the widget hasn't beed positioned yet
if (!sGdkWindowMoveToRect || !gdkWindow || !AreBoundsSane()) {
if (!sGdkWindowMoveToRect || !gdkWindow) {
gtk_window_move(GTK_WINDOW(mShell), aPosition->x, aPosition->y);
return;
}