Compare commits

...

2 Commits

2 changed files with 21 additions and 2 deletions

View File

@ -188,8 +188,16 @@ fastiv_view_realize(GtkWidget *widget)
&attributes, GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL); &attributes, GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL);
// Without the following call, or the rendering mode set to "recording", // Without the following call, or the rendering mode set to "recording",
// RGB30 degrades to RGB24. It completely breaks the Quartz backend. // RGB30 degrades to RGB24, because gdk_window_begin_paint_internal()
// creates backing stores using cairo_content_t constants.
//
// It completely breaks the Quartz backend, so limit it to X11.
#ifdef GDK_WINDOWING_X11 #ifdef GDK_WINDOWING_X11
// FIXME: This causes some flicker while scrolling, because it disables
// double buffering, see: https://gitlab.gnome.org/GNOME/gtk/-/issues/2560
//
// If GTK+'s OpenGL integration fails to deliver, we need to use the window
// directly, sidestepping the toolkit entirely.
if (GDK_IS_X11_WINDOW(window)) if (GDK_IS_X11_WINDOW(window))
gdk_window_ensure_native(window); gdk_window_ensure_native(window);
#endif // GDK_WINDOWING_X11 #endif // GDK_WINDOWING_X11

View File

@ -153,7 +153,12 @@ open(const gchar *path)
return; return;
} }
gtk_recent_manager_add_item(gtk_recent_manager_get_default(), path); gchar *uri = g_filename_to_uri(path, NULL, NULL);
if (uri) {
gtk_recent_manager_add_item(gtk_recent_manager_get_default(), path);
g_free(uri);
}
gtk_window_set_title(GTK_WINDOW(g.window), path); gtk_window_set_title(GTK_WINDOW(g.window), path);
gtk_stack_set_visible_child(GTK_STACK(g.stack), g.view_scroller); gtk_stack_set_visible_child(GTK_STACK(g.stack), g.view_scroller);
@ -394,6 +399,12 @@ main(int argc, char *argv[])
gtk_container_add(GTK_CONTAINER(g.view_scroller), g.view); gtk_container_add(GTK_CONTAINER(g.view_scroller), g.view);
gtk_widget_show_all(g.view_scroller); gtk_widget_show_all(g.view_scroller);
// Maybe our custom widgets should derive colours from the theme instead.
gtk_scrolled_window_set_overlay_scrolling(
GTK_SCROLLED_WINDOW(g.view_scroller), FALSE);
g_object_set(gtk_settings_get_default(),
"gtk-application-prefer-dark-theme", TRUE, NULL);
g.browser_scroller = gtk_scrolled_window_new(NULL, NULL); g.browser_scroller = gtk_scrolled_window_new(NULL, NULL);
g.browser = g_object_new(FASTIV_TYPE_BROWSER, NULL); g.browser = g_object_new(FASTIV_TYPE_BROWSER, NULL);
gtk_widget_set_vexpand(g.browser, TRUE); gtk_widget_set_vexpand(g.browser, TRUE);