diff options
author | Vincent Sanders <vince@kyllikki.org> | 2019-08-01 17:22:17 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2019-08-01 19:51:19 +0100 |
commit | 57427620704c707fa5d50eb6f01a5c4654708c4c (patch) | |
tree | db046ce7188be5133fbbaf4da7da7e167858a601 /frontends/windows/main.c | |
parent | f4f67698eb6eb92a8ac606f771401c0c480d0ad5 (diff) | |
download | netsurf-57427620704c707fa5d50eb6f01a5c4654708c4c.tar.gz netsurf-57427620704c707fa5d50eb6f01a5c4654708c4c.tar.bz2 |
split browser and browser_window operations
Diffstat (limited to 'frontends/windows/main.c')
-rw-r--r-- | frontends/windows/main.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/frontends/windows/main.c b/frontends/windows/main.c index b021751c9..6592e1626 100644 --- a/frontends/windows/main.c +++ b/frontends/windows/main.c @@ -34,6 +34,7 @@ #include "utils/nsoption.h" #include "netsurf/url_db.h" #include "netsurf/cookie_db.h" +#include "netsurf/browser.h" #include "netsurf/browser_window.h" #include "netsurf/fetch.h" #include "netsurf/misc.h" @@ -62,6 +63,26 @@ char **respaths; /** exported global defined in windows/gui.h */ char *nsw32_config_home; /* exported global defined in windows/gui.h */ /** + * Obtain the DPI of the display. + * + * \return The DPI of the device the window is displayed on. + */ +static int get_screen_dpi(void) +{ + HDC screendc = GetDC(0); + int dpi = GetDeviceCaps(screendc, LOGPIXELSY); + ReleaseDC(0, screendc); + + if (dpi <= 10) { + dpi = 96; /* 96DPI is the default */ + } + + NSLOG(netsurf, INFO, "FIX DPI %d", dpi); + + return dpi; +} + +/** * Get the path to the config directory. * * This ought to use SHGetKnownFolderPath(FOLDERID_RoamingAppData) and @@ -393,6 +414,8 @@ WinMain(HINSTANCE hInstance, HINSTANCE hLastInstance, LPSTR lpcli, int ncmd) return 1; } + browser_set_dpi(get_screen_dpi()); + urldb_load(nsoption_charp(url_file)); urldb_load_cookies(nsoption_charp(cookie_file)); hotlist_init(nsoption_charp(hotlist_path), |