Bug 1240643 - Dispatch a pending resize event before fetching screen bounds on GTK. r?karlt
MozReview-Commit-ID: CYtLSywPDyr
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -1497,16 +1497,19 @@ nsWindow::SetFocus(bool aRaise)
(void *)this));
return NS_OK;
}
NS_IMETHODIMP
nsWindow::GetScreenBounds(LayoutDeviceIntRect& aRect)
{
+ // Ensure that layout is informed of a pending resize first.
+ MaybeDispatchResized();
+
if (mIsTopLevel && mContainer) {
// use the point including window decorations
gint x, y;
gdk_window_get_root_origin(gtk_widget_get_window(GTK_WIDGET(mContainer)), &x, &y);
aRect.MoveTo(GdkPointToDevicePixels({ x, y }));
} else {
aRect.MoveTo(WidgetToScreenOffset());
}