diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-11-20 13:03:30 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-11-20 13:04:26 +0100 |
commit | 2b8350ecebec5cca5edd25951bdb3f0c0b8ee4b5 (patch) | |
tree | 77030fea62c39aecffe2d3b6c3026e7dfba7f34b /fastiv-view.c | |
parent | 75994cd85aa6d207d8867f03ec3759de0b435b23 (diff) | |
download | fiv-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.c | 13 |
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); |