Subject: bug#20677: tooltips generate garbage

From: Angelo Graziosi <[email-masked]>
Date: Wed, 03 Jun 2015 15:51:49 +0200

Il 03/06/2015 09:01, YAMAMOTO Mitsuharu ha scritto:
>>>>>> On Tue, 02 Jun 2015 22:08:59 +0300, Eli Zaretskii <[email-masked]> said:
>
>>>> Can you see whether Emacs gets an expose event when the tip pops down?
>>>
>>> Sorry, you've found my limit in understanding.  How can check that?
>
>> The function expose_frame (defined in xdisp.c) should be called when
>> such an event comes in.
>
> Could those who see this problem try the following patches, one at a
> time?

Here (GNU/Linux Mint 17.1 Mate 64bit) both patches seem to work fine!

  Ciao,
    Angelo.

>
> [FIRST]
> diff --git a/src/xterm.c b/src/xterm.c
> index 25c0d87..691ede5 100644
> --- a/src/xterm.c
> +++ b/src/xterm.c
> @@ -7668,7 +7668,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
>               }
>             else
>   	    {
> -#if defined (USE_GTK) && ! defined (HAVE_GTK3) && ! defined (USE_CAIRO)
> +#ifdef USE_GTK
>   	      /* This seems to be needed for GTK 2.6 and later, see
>   		 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15398.  */
>   	      x_clear_area (f,
>
>
> [SECOND]
> diff --git a/src/xterm.c b/src/xterm.c
> index 25c0d87..32d4d3a 100644
> --- a/src/xterm.c
> +++ b/src/xterm.c
> @@ -7668,12 +7668,14 @@ handle_one_xevent (struct x_display_info *dpyinfo,
>               }
>             else
>   	    {
> -#if defined (USE_GTK) && ! defined (HAVE_GTK3) && ! defined (USE_CAIRO)
> +#ifdef USE_GTK
>   	      /* This seems to be needed for GTK 2.6 and later, see
>   		 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15398.  */
> -	      x_clear_area (f,
> -			    event->xexpose.x, event->xexpose.y,
> -			    event->xexpose.width, event->xexpose.height);
> +	      x_clear_area1 (event->xexpose.display,
> +			     event->xexpose.window,
> +			     event->xexpose.x, event->xexpose.y,
> +			     event->xexpose.width, event->xexpose.height,
> +			     False);
>   #endif
>   	      expose_frame (f, event->xexpose.x, event->xexpose.y,
>   			    event->xexpose.width, event->xexpose.height);
>