diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-10 03:30:44 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-10 03:30:44 +0000 |
commit | 39752979b8e51681a77ce87f87e8a9342b44c7a6 (patch) | |
tree | e2dca3bf94c1a1dcb64bed7a02e45943c4a5e57c | |
parent | fc3fc45793bbd882909b01e2c0f771741f4849ed (diff) | |
download | chromium_src-39752979b8e51681a77ce87f87e8a9342b44c7a6.zip chromium_src-39752979b8e51681a77ce87f87e8a9342b44c7a6.tar.gz chromium_src-39752979b8e51681a77ce87f87e8a9342b44c7a6.tar.bz2 |
Linux: save BrowserWindowGtk's vbox as a member variable
also update the WebContents display hack to not crash on startup
Review URL: http://codereview.chromium.org/21204
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9449 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 15 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.h | 1 |
2 files changed, 12 insertions, 4 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 6724a7f..b5dc869 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -40,6 +40,11 @@ gfx::Rect GetInitialWindowBounds(GtkWindow* window) { return gfx::Rect(x, y, width, height); } +gboolean FalseMachine(GtkWindow* window, GdkEventWindowState* event, + BrowserWindowGtk* browser_win) { + return FALSE; +} + } // namespace BrowserWindowGtk::BrowserWindowGtk(Browser* browser) : browser_(browser) { @@ -58,17 +63,19 @@ void BrowserWindowGtk::Init() { G_CALLBACK(MainWindowDestroyed), this); g_signal_connect(G_OBJECT(window_), "configure-event", G_CALLBACK(MainWindowConfigured), this); + g_signal_connect(G_OBJECT(window_), "expose-event", + G_CALLBACK(FalseMachine), this); g_signal_connect(G_OBJECT(window_), "window-state-event", G_CALLBACK(MainWindowStateChanged), this); bounds_ = GetInitialWindowBounds(window_); - GtkWidget* vbox = gtk_vbox_new(FALSE, 0); + vbox_ = gtk_vbox_new(FALSE, 0); toolbar_.reset(new BrowserToolbarGtk(browser_.get())); toolbar_->Init(browser_->profile()); - toolbar_->AddToolbarToBox(vbox); + toolbar_->AddToolbarToBox(vbox_); - gtk_container_add(GTK_CONTAINER(window_), vbox); + gtk_container_add(GTK_CONTAINER(window_), vbox_); } void BrowserWindowGtk::Show() { @@ -78,7 +85,7 @@ void BrowserWindowGtk::Show() { WebContents* contents = (WebContents*)(browser_->GetTabContentsAt(0)); content_area_ = ((RenderWidgetHostViewGtk*)contents-> render_view_host()->view())->native_view(); - gtk_container_add(GTK_CONTAINER(window_), content_area_); + gtk_box_pack_start(GTK_BOX(vbox_), content_area_, TRUE, TRUE, 0); contents->NavigateToPendingEntry(false); } diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h index 231ceae..96a7992 100644 --- a/chrome/browser/gtk/browser_window_gtk.h +++ b/chrome/browser/gtk/browser_window_gtk.h @@ -65,6 +65,7 @@ class BrowserWindowGtk : public BrowserWindow { protected: virtual void DestroyBrowser(); GtkWindow* window_; + GtkWidget* vbox_; GtkWidget* content_area_; scoped_ptr<Browser> browser_; |