aboutsummaryrefslogtreecommitdiff
path: root/fastiv-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'fastiv-view.c')
-rw-r--r--fastiv-view.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fastiv-view.c b/fastiv-view.c
index 602e4e5..35b19fa 100644
--- a/fastiv-view.c
+++ b/fastiv-view.c
@@ -198,7 +198,6 @@ fastiv_view_realize(GtkWidget *widget)
#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
- // FIXME: It also breaks Tab-switching at the start of program.
//
// If GTK+'s OpenGL integration fails to deliver, we need to use the window
// directly, sidestepping the toolkit entirely.
@@ -214,16 +213,18 @@ fastiv_view_realize(GtkWidget *widget)
static gboolean
fastiv_view_draw(GtkWidget *widget, cairo_t *cr)
{
- FastivView *self = FASTIV_VIEW(widget);
- if (!self->surface ||
- !gtk_cairo_should_draw_window(cr, gtk_widget_get_window(widget)))
- return TRUE;
-
+ // Placed here due to our using a native GdkWindow on X11,
+ // which makes the widget have no double buffering or default background.
GtkAllocation allocation;
gtk_widget_get_allocation(widget, &allocation);
gtk_render_background(gtk_widget_get_style_context(widget), cr, 0, 0,
allocation.width, allocation.height);
+ FastivView *self = FASTIV_VIEW(widget);
+ if (!self->surface ||
+ !gtk_cairo_should_draw_window(cr, gtk_widget_get_window(widget)))
+ return TRUE;
+
int w, h;
get_display_dimensions(self, &w, &h);