From 4f03905955692eb2c8e0a4262a0486e44b468377 Mon Sep 17 00:00:00 2001 From: Rob Kendrick Date: Fri, 17 Dec 2010 13:07:38 +0000 Subject: Move setting of the CSS DPI to before any treeviews are created, from when the first browser window is created. svn path=/trunk/netsurf/; revision=11086 --- gtk/gtk_gui.c | 10 ++++++++++ gtk/gtk_scaffolding.c | 4 ---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gtk/gtk_gui.c b/gtk/gtk_gui.c index 7eb9446ca..ed20d9b8e 100644 --- a/gtk/gtk_gui.c +++ b/gtk/gtk_gui.c @@ -55,6 +55,7 @@ #include "desktop/searchweb.h" #include "desktop/sslcert.h" #include "desktop/textinput.h" +#include "css/utils.h" #include "gtk/dialogs/gtk_options.h" #include "gtk/gtk_completion.h" #include "gtk/gtk_cookies.h" @@ -497,6 +498,15 @@ static void gui_init(int argc, char** argv, char **respath) urldb_load(option_url_file); urldb_load_cookies(option_cookie_file); + /* The tree view system needs to know the screen's DPI, so we + * find that out here, rather than when we create a first browser + * window. + */ + + nscss_screen_dpi = FLTTOFIX(gdk_screen_get_resolution( + gdk_screen_get_default())); + LOG(("Set CSS DPI to %f", FIXTOFLT(nscss_screen_dpi))); + if (nsgtk_history_init(glade_history_file_location) == false) die("Unable to initialise history window.\n"); diff --git a/gtk/gtk_scaffolding.c b/gtk/gtk_scaffolding.c index 66ea4e769..073d85776 100644 --- a/gtk/gtk_scaffolding.c +++ b/gtk/gtk_scaffolding.c @@ -1502,10 +1502,6 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel) g->preferences_dialog = NULL; - nscss_screen_dpi = FLTTOFIX(gdk_screen_get_resolution( - gtk_widget_get_screen(GTK_WIDGET(g->window)))); - LOG(("Set CSS DPI to %f", FIXTOFLT(nscss_screen_dpi))); - /* set this window's size and position to what's in the options, or * or some sensible default if they're not set yet. */ -- cgit v1.2.3