summaryrefslogtreecommitdiff
path: root/src/xterm.c
diff options
context:
space:
mode:
authorAri Roponen <ari.roponen@gmail.com>2018-11-30 14:09:09 +0200
committerEli Zaretskii <eliz@gnu.org>2018-12-08 11:50:00 +0200
commit1d743d2461a5a90893a0cbe62239f31b321a844d (patch)
treef4fec04c8d10c4a1e2117c0f55befaa995023d62 /src/xterm.c
parent2b9e9937b41b4d5b20d551ac04bdcc253eeaa37a (diff)
downloademacs-1d743d2461a5a90893a0cbe62239f31b321a844d.tar.gz
emacs-1d743d2461a5a90893a0cbe62239f31b321a844d.tar.bz2
emacs-1d743d2461a5a90893a0cbe62239f31b321a844d.zip
Fix scaling problem in Cairo builds
* src/xterm.c (x_begin_cr_clip) [USE_GTK]: (x_update_begin) [USE_CAIRO && USE_GTK]: Support scaling. (Bug#33442)
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/xterm.c b/src/xterm.c
index b2d1b5c1980..8157612b293 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -360,10 +360,15 @@ x_begin_cr_clip (struct frame *f, GC gc)
if (! FRAME_CR_SURFACE (f))
{
+ int scale = 1;
+#ifdef USE_GTK
+ scale = xg_get_scale (f);
+#endif
+
FRAME_CR_SURFACE (f) =
cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
- FRAME_PIXEL_WIDTH (f),
- FRAME_PIXEL_HEIGHT (f));
+ scale * FRAME_PIXEL_WIDTH (f),
+ scale * FRAME_PIXEL_HEIGHT (f));
}
cr = cairo_create (FRAME_CR_SURFACE (f));
FRAME_CR_CONTEXT (f) = cr;
@@ -1006,8 +1011,9 @@ x_update_begin (struct frame *f)
if (FRAME_GTK_WIDGET (f))
{
GdkWindow *w = gtk_widget_get_window (FRAME_GTK_WIDGET (f));
- width = gdk_window_get_width (w);
- height = gdk_window_get_height (w);
+ int scale = xg_get_scale (f);
+ width = scale * gdk_window_get_width (w);
+ height = scale * gdk_window_get_height (w);
}
else
#endif