diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-18 09:30:24 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-18 09:30:24 +0000 |
commit | 4236df757e45014700da962b9a20d46f61b4440f (patch) | |
tree | fac2e611ef6a829e4f1a7507e6ccdf0e56fa82a0 /chrome | |
parent | 57973e376f2be72e3045d89daf3293dd73a87eca (diff) | |
download | chromium_src-4236df757e45014700da962b9a20d46f61b4440f.zip chromium_src-4236df757e45014700da962b9a20d46f61b4440f.tar.gz chromium_src-4236df757e45014700da962b9a20d46f61b4440f.tar.bz2 |
linux: clean up a bit of redundant logic
I noticed this while looking for something else. In theory, this
will reduce flashing when the dialog comes up (since we first do
all the layout of the contents and then once that's all done we
show the window), but I haven't verified that.
Review URL: http://codereview.chromium.org/608034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39345 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/gtk/options/options_window_gtk.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/chrome/browser/gtk/options/options_window_gtk.cc b/chrome/browser/gtk/options/options_window_gtk.cc index d0330b9..82d868f 100644 --- a/chrome/browser/gtk/options/options_window_gtk.cc +++ b/chrome/browser/gtk/options/options_window_gtk.cc @@ -154,18 +154,18 @@ OptionsWindowGtk::OptionsWindowGtk(Profile* profile) DCHECK_EQ( gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook_)), OPTIONS_PAGE_COUNT); + // Show the content so that we can compute full dialog size, both + // for centering and because we want to show the notebook before + // connecting switch-page signal, otherwise we'll immediately get a + // signal switching to page 0 and overwrite our last_selected_page_ + // value. + gtk_widget_show_all(gtk_bin_get_child(GTK_BIN(dialog_))); + if (Browser* b = BrowserList::GetLastActive()) { - // Show container content so that we can compute full dialog size. - gtk_widget_show_all(notebook_); gtk_util::CenterOverWindow(GTK_WINDOW(dialog_), b->window()->GetNativeHandle()); } - // Need to show the notebook before connecting switch-page signal, otherwise - // we'll immediately get a signal switching to page 0 and overwrite our - // last_selected_page_ value. - gtk_widget_show_all(dialog_); - g_signal_connect(notebook_, "switch-page", G_CALLBACK(OnSwitchPage), this); // We only have one button and don't do any special handling, so just hook it @@ -173,6 +173,8 @@ OptionsWindowGtk::OptionsWindowGtk(Profile* profile) g_signal_connect(dialog_, "response", G_CALLBACK(gtk_widget_destroy), NULL); g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroy), this); + + gtk_widget_show(dialog_); } OptionsWindowGtk::~OptionsWindowGtk() { |