static char *strictssl = FALSE; /* Refuse untrusted SSL connections */
static Bool kioskmode = FALSE; /* Ignore shortcuts */
static Bool showindicators = TRUE; /* Show indicators in window title */
+static Bool zoomto96dpi = TRUE; /* Zoom pages to always emulate 96dpi */
static guint defaultfontsize = 12;
WebKitWebSettings *settings;
WebKitWebFrame *frame;
GdkGeometry hints = { 1, 1 };
+ GdkScreen *screen;
+ gdouble dpi;
char *uri, *ua;
if(!(c = calloc(1, sizeof(Client))))
g_object_set(G_OBJECT(settings), "default-font-size",
defaultfontsize, NULL);
+ /* While stupid, CSS specifies that a pixel represents 1/96 of an inch.
+ * This ensures websites are not unusably small with a high DPI screen.
+ * It is equivalent to firefox's "layout.css.devPixelsPerPx" setting. */
+ if(zoomto96dpi) {
+ screen = gdk_window_get_screen(GTK_WIDGET(c->win)->window);
+ dpi = gdk_screen_get_resolution(screen);
+ if(dpi != -1) {
+ g_object_set(G_OBJECT(settings), "enforce-96-dpi", true,
+ NULL);
+ webkit_web_view_set_zoom_level(c->view, dpi/96);
+ }
+ }
+
if(enableinspector) {
c->inspector = WEBKIT_WEB_INSPECTOR(
webkit_web_view_get_inspector(c->view));