aboutsummaryrefslogtreecommitdiff
path: root/fastiv-view.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-20 13:03:30 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-20 13:04:26 +0100
commit2b8350ecebec5cca5edd25951bdb3f0c0b8ee4b5 (patch)
tree77030fea62c39aecffe2d3b6c3026e7dfba7f34b /fastiv-view.c
parent75994cd85aa6d207d8867f03ec3759de0b435b23 (diff)
downloadfiv-2b8350ecebec5cca5edd25951bdb3f0c0b8ee4b5.tar.gz
fiv-2b8350ecebec5cca5edd25951bdb3f0c0b8ee4b5.tar.xz
fiv-2b8350ecebec5cca5edd25951bdb3f0c0b8ee4b5.zip
Fix some issues with browser/view switching
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);