summaryrefslogtreecommitdiff
path: root/src/gtk_fb.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-03-22 10:53:08 -0700
committerVito Caputo <vcaputo@pengaru.com>2022-03-22 10:53:08 -0700
commit0da5c78ec1b13044d3b6e6211c4e74e0599eb9fe (patch)
treeee767954ff3edb02df43e83853b88d672c7c2607 /src/gtk_fb.c
parentac95ac64a636c661c192dd5b2b48283fed5bf711 (diff)
gtk_fb: when creating page surfaces don't inherit scaling
When calling gdk_window_create_similar_image_surface() I was supplying '0' for the scaling factor which is just a blind "inherit scaling from the window" request. This is fine when the window isn't being scaled; everything is just 1:1. But when the window is scaled, and our output has been sized according to the widget allocation (unscaled), these scaling factors can't be the same if we intend for the page contents to fill the scaled output. Specify a scale of 1 instead, as that's how the allocation size coordinates should be viewed, like normalized units. The window scale is how many times those units the window coordinates are in. This should fix highdpi/GDK_SCALE=2 usage.
Diffstat (limited to 'src/gtk_fb.c')
-rw-r--r--src/gtk_fb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gtk_fb.c b/src/gtk_fb.c
index 7a6c12b..5328d05 100644
--- a/src/gtk_fb.c
+++ b/src/gtk_fb.c
@@ -176,7 +176,7 @@ static void * gtk_fb_page_alloc(til_fb_t *fb, void *context, til_fb_page_t *res_
* potential optimizations like XSHM use on the xlib cairo backend.
*/
gdk_window = gtk_widget_get_window(c->window);
- p->surface = gdk_window_create_similar_image_surface(gdk_window, CAIRO_FORMAT_RGB24, c->width, c->height, 0);
+ p->surface = gdk_window_create_similar_image_surface(gdk_window, CAIRO_FORMAT_RGB24, c->width, c->height, 1);
res_page->fragment.buf = (uint32_t *)cairo_image_surface_get_data(p->surface);
res_page->fragment.width = c->width;
© All Rights Reserved