gtk: Force size allocation in window, fixes #219.
This commit is contained in:
parent
5a837f5850
commit
7e7f0888e5
1 changed files with 6 additions and 0 deletions
|
@ -52,6 +52,12 @@ NativeWindowGtk::NativeWindowGtk(content::WebContents* web_contents,
|
||||||
options->GetInteger(switches::kHeight, &height);
|
options->GetInteger(switches::kHeight, &height);
|
||||||
SetSize(gfx::Size(width, 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())
|
if (!icon_.IsEmpty())
|
||||||
gtk_window_set_icon(window_, icon_.ToGdkPixbuf());
|
gtk_window_set_icon(window_, icon_.ToGdkPixbuf());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue