diff options
-rw-r--r-- | chrome/browser/gtk/browser_titlebar.cc | 21 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/tab_strip_gtk.cc | 6 |
2 files changed, 18 insertions, 9 deletions
diff --git a/chrome/browser/gtk/browser_titlebar.cc b/chrome/browser/gtk/browser_titlebar.cc index b9a10d3..11d3499 100644 --- a/chrome/browser/gtk/browser_titlebar.cc +++ b/chrome/browser/gtk/browser_titlebar.cc @@ -111,13 +111,14 @@ void BrowserTitlebar::Init() { // If we're a popup window or in app mode, we don't display the spy guy or // the tab strip. Instead, put an hbox in titlebar_alignment_ in place of // the tab strip. - // +- Alignment (titlebar_alignment_) ----------------------------+ - // |+ HBox ------------------------------------------------------+| - // ||+- Image (app_mode_favicon_) -++- Label (app_mode_title_) -+|| - // ||| favicon || page title ||| - // ||+-----------------------------++---------------------------+|| - // |+------------------------------------------------------------+| - // +--------------------------------------------------------------+ + // +- Alignment (titlebar_alignment_) -----------------------------------+ + // |+ HBox -------------------------------------------------------------+| + // ||+- TabStripGtk -++- Image ----------------++- Label --------------+|| + // ||| hidden ++ (app_mode_favicon_) || (app_mode_title_) ||| + // ||| || favicon || page title ||| + // ||+---------------++------------------------++----------------------+|| + // |+-------------------------------------------------------------------+| + // +---------------------------------------------------------------------+ GtkWidget* container_hbox = gtk_hbox_new(FALSE, 0); container_ = gtk_event_box_new(); @@ -160,6 +161,12 @@ void BrowserTitlebar::Init() { GtkWidget* app_mode_hbox = gtk_hbox_new(FALSE, kIconTitleSpacing); gtk_container_add(GTK_CONTAINER(titlebar_alignment_), app_mode_hbox); + // Put the tab strip in the hbox even though we don't show it. Sometimes + // we need the position of the tab strip so make sure it's in our widget + // hierarchy. + gtk_box_pack_start(GTK_BOX(app_mode_hbox), + browser_window_->tabstrip()->widget(), FALSE, FALSE, 0); + // We use the app logo as a placeholder image so the title doesn't jump // around. ResourceBundle& rb = ResourceBundle::GetSharedInstance(); diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc index 3af798a..20d5c38 100644 --- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc @@ -850,8 +850,10 @@ gfx::Point TabStripGtk::GetTabStripOriginForWidget(GtkWidget* target) { -widget()->allocation.x, 0, &x, &y)) { // If the tab strip isn't showing, give the coordinates relative to the // toplevel instead. - gtk_widget_translate_coordinates( - gtk_widget_get_toplevel(widget()), target, 0, 0, &x, &y); + if (!gtk_widget_translate_coordinates( + gtk_widget_get_toplevel(widget()), target, 0, 0, &x, &y)) { + NOTREACHED(); + } } if (GTK_WIDGET_NO_WINDOW(target)) { x += target->allocation.x; |