From: Cheng Zhao Date: Fri, 28 Mar 2014 08:01:38 +0000 (+0800) Subject: gtk: Force size allocation in window, fixes #219. X-Git-Tag: v0.11.5~11 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=7e7f0888e5202f9e3b8a59b2f6c31f8252e98922;p=electron.git gtk: Force size allocation in window, fixes #219. --- 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());