Subject: bug#20677: tooltips generate garbage

From: YAMAMOTO Mitsuharu <[email-masked]>
Date: Wed, 03 Jun 2015 16:01:04 +0900

>>>>> 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?

				     YAMAMOTO Mitsuharu
				[email-masked]

[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);