#define FEATURE_TITLE_PROGRESS
/* should the history indicator [+-] be shown in status bar after url */
#define FEATURE_HISTORY_INDICATOR
+/* enables workaround for hight dpi displays */
+#define FEATURE_HIGH_DPI
/* time in seconds after that message will be removed from inputbox if the
/* make sure the main window and all its contents are visible */
gtk_widget_show_all(gui->window);
+
+ vb.config.default_zoom = 1.0;
+
+#ifdef FEATURE_HIGH_DPI
+ /* fix for high dpi displays */
+ GdkScreen *screen = gdk_window_get_screen(GTK_WIDGET(vb.gui.window)->window);
+ gdouble dpi = gdk_screen_get_resolution(screen);
+ if (dpi != -1) {
+ WebKitWebSettings *setting = webkit_web_view_get_settings(gui->webview);
+ webkit_web_view_set_full_content_zoom(gui->webview, true);
+ g_object_set(G_OBJECT(setting), "enforce-96-dpi", true, NULL);
+
+ /* calculate the zoom level based on 96 dpi */
+ vb.config.default_zoom = dpi/96;
+
+ webkit_web_view_set_zoom_level(gui->webview, vb.config.default_zoom);
+ }
+#endif
}
static void marks_clear(void)
char *autocmd; /* command given by --cmd option */
char *cafile; /* path to the ca file */
GTlsDatabase *tls_db; /* tls database */
+ float default_zoom; /* default zoomlevel that is applied on zz zoom reset */
} Config;
typedef struct {
count = info->count ? (float)info->count : 1.0;
if (info->key2 == 'z') { /* zz reset zoom */
- webkit_web_view_set_zoom_level(view, 1.0);
+#ifdef FEATURE_HIGH_DPI
+ /* to set the zoom for high dpi displays we need full content zoom */
+ webkit_web_view_set_full_content_zoom(view, true);
+#endif
+ webkit_web_view_set_zoom_level(view, vb.config.default_zoom);
return RESULT_COMPLETE;
}