]> code.delx.au - gnu-emacs/blobdiff - src/xterm.c
Cleanup tooltips
[gnu-emacs] / src / xterm.c
index cd1d712f39ad28cd07bc1caa9871d2d10d63df9c..ada1160ec908aa8789a01df475ec010a9a182435 100644 (file)
@@ -987,8 +987,7 @@ static void
 x_update_begin (struct frame *f)
 {
 #ifdef USE_CAIRO
-  if (! NILP (tip_frame) && XFRAME (tip_frame) == f
-      && ! FRAME_VISIBLE_P (f))
+  if (FRAME_TOOLTIP_P (f) && ! FRAME_VISIBLE_P (f))
     return;
 
   if (! FRAME_CR_SURFACE (f))
@@ -7839,11 +7838,9 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
     case UnmapNotify:
       /* Redo the mouse-highlight after the tooltip has gone.  */
-      if (event->xunmap.window == tip_window)
-        {
-          tip_window = 0;
-          x_redo_mouse_highlight (dpyinfo);
-        }
+      if (dpyinfo->x_tooltip_frame
+         && FRAME_X_WINDOW (dpyinfo->x_tooltip_frame) == event->xunmap.window)
+       x_redo_mouse_highlight (dpyinfo);
 
       f = x_top_window_to_frame (dpyinfo, event->xunmap.window);
       if (f)           /* F may no longer exist if
@@ -8433,7 +8430,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
 #ifdef USE_X_TOOLKIT
           /* Tip frames are pure X window, set size for them.  */
-          if (! NILP (tip_frame) && XFRAME (tip_frame) == f)
+          if (FRAME_TOOLTIP_P (f))
             {
               if (FRAME_PIXEL_HEIGHT (f) != configureEvent.xconfigure.height
                   || FRAME_PIXEL_WIDTH (f) != configureEvent.xconfigure.width)
@@ -9614,7 +9611,7 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
       /* Don't change the size of a tip frame; there's no point in
         doing it because it's done in Fx_show_tip, and it leads to
         problems because the tip frame has no widget.  */
-      if (NILP (tip_frame) || XFRAME (tip_frame) != f)
+      if (!FRAME_TOOLTIP_P (f))
        {
          adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
                             FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 3,
@@ -10689,7 +10686,7 @@ x_set_window_size (struct frame *f, bool change_gravity,
   /* The following breaks our calculations.  If it's really needed,
      think of something else.  */
 #if false
-  if (NILP (tip_frame) || XFRAME (tip_frame) != f)
+  if (!FRAME_TOOLTIP_P (f))
     {
       int text_width, text_height;
 
@@ -11340,6 +11337,8 @@ x_free_frame_resources (struct frame *f)
     dpyinfo->x_focus_event_frame = 0;
   if (f == dpyinfo->x_highlight_frame)
     dpyinfo->x_highlight_frame = 0;
+  if (f == dpyinfo->x_tooltip_frame)
+    dpyinfo->x_tooltip_frame = 0;
   if (f == hlinfo->mouse_face_mouse_frame)
     reset_mouse_highlight (hlinfo);