diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index d5c15d9a20c3..e0c7536e330b 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -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; }