From 7e7f0888e5202f9e3b8a59b2f6c31f8252e98922 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 28 Mar 2014 16:01:38 +0800 Subject: [PATCH] gtk: Force size allocation in window, fixes #219. --- atom/browser/native_window_gtk.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/atom/browser/native_window_gtk.cc b/atom/browser/native_window_gtk.cc index 50eeebf7..e1b7bddb 100644 --- a/atom/browser/native_window_gtk.cc +++ b/atom/browser/native_window_gtk.cc @@ -52,6 +52,12 @@ NativeWindowGtk::NativeWindowGtk(content::WebContents* web_contents, options->GetInteger(switches::kHeight, &height); SetSize(gfx::Size(width, height)); + // Force a size allocation so the web page of hidden window can have correct + // value of $(window).width(). + GtkAllocation size = { 0, 0, width, height }; + gtk_widget_show_all(vbox_); + gtk_widget_size_allocate(GTK_WIDGET(window_), &size); + if (!icon_.IsEmpty()) gtk_window_set_icon(window_, icon_.ToGdkPixbuf()); -- 2.43.0