GNU bug report logs - #31288
27.0.50; [PATCH] Make cairo build somewhat usable

Previous Next

Package: emacs;

Reported by: Ari Roponen <ari.roponen <at> gmail.com>

Date: Fri, 27 Apr 2018 13:20:02 UTC

Severity: normal

Tags: patch

Found in version 27.0.50

Done: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>

Bug is archived. No further changes may be made.

Full log


Message #35 received at control <at> debbugs.gnu.org (full text, mbox):

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: Ari Roponen <ari.roponen <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 31288 <at> debbugs.gnu.org
Subject: Re: bug#31288: [PATCH v2] Make cairo build usable
Date: Tue, 26 Mar 2019 10:25:48 +0900
unarchive 31288
reopen 31288
quit

On Sun, 06 May 2018 21:36:55 +0900,
Ari Roponen wrote:

> [1  <text/plain (7bit)>]
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Thanks, pushed to the master branch.
> 
> Thank you very much. However, I just noticed that my patch doesn't work
> with side-by-side split windows. The following patch should fix that.
> 
> [2 0001-Fix-cairo-scrolling-for-side-by-side-windows.patch <text/x-patch (7bit)>]
> >From 788f0fc62881152b03043057fe98178d77a6bb3a Mon Sep 17 00:00:00 2001
> From: Ari Roponen <ari.roponen <at> gmail.com>
> Date: Sun, 6 May 2018 15:29:28 +0300
> Subject: [PATCH] Fix cairo scrolling for side-by-side windows
> 
> * src/xterm.c (x_scroll_run) [USE_CAIRO]: Fix scrolling for
> side-by-side split windows.
> ---
>  src/xterm.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/xterm.c b/src/xterm.c
> index 35e10568fa..3f956d950d 100644
> --- a/src/xterm.c
> +++ b/src/xterm.c
> @@ -4260,6 +4260,7 @@ x_scroll_run (struct window *w, struct run *run)
>  #ifdef USE_CAIRO
>    if (FRAME_CR_CONTEXT (f))
>      {
> +      int wx = WINDOW_LEFT_EDGE_X (w);
>        cairo_surface_t *s = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
>  						       width, height);
>        cairo_t *cr = cairo_create (s);
> @@ -4270,8 +4271,8 @@ x_scroll_run (struct window *w, struct run *run)
>  
>        cr = FRAME_CR_CONTEXT (f);
>        cairo_save (cr);
> -      cairo_set_source_surface (cr, s, 0, to_y);
> -      cairo_rectangle (cr, x, to_y, width, height);
> +      cairo_set_source_surface (cr, s, wx, to_y);
> +      cairo_rectangle (cr, wx, to_y, width, height);
>        cairo_fill (cr);
>        cairo_restore (cr);
>        cairo_surface_destroy (s);
> -- 
> 2.17.0
> 

It causes display corruption when scroll bars are on the left.  I
think the patch below will fix it.

				     YAMAMOTO Mitsuharu
				mituharu <at> math.s.chiba-u.ac.jp


diff --git a/src/xterm.c b/src/xterm.c
index 1b0c2f5ec5..e3034772a4 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4315,7 +4315,6 @@ x_scroll_run (struct window *w, struct run *run)
 #ifdef USE_CAIRO
   if (FRAME_CR_CONTEXT (f))
     {
-      int wx = WINDOW_LEFT_EDGE_X (w);
       cairo_surface_t *s = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
 						       width, height);
       cairo_t *cr = cairo_create (s);
@@ -4326,8 +4325,8 @@ x_scroll_run (struct window *w, struct run *run)
 
       cr = FRAME_CR_CONTEXT (f);
       cairo_save (cr);
-      cairo_set_source_surface (cr, s, wx, to_y);
-      cairo_rectangle (cr, wx, to_y, width, height);
+      cairo_set_source_surface (cr, s, x, to_y);
+      cairo_rectangle (cr, x, to_y, width, height);
       cairo_fill (cr);
       cairo_restore (cr);
       cairo_surface_destroy (s);






This bug report was last modified 6 years and 118 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.