]> code.delx.au - gnu-emacs/blobdiff - src/xterm.c
Revert "Cleanup tooltips"
[gnu-emacs] / src / xterm.c
index ada1160ec908aa8789a01df475ec010a9a182435..cd1d712f39ad28cd07bc1caa9871d2d10d63df9c 100644 (file)
@@ -987,7 +987,8 @@ static void
 x_update_begin (struct frame *f)
 {
 #ifdef USE_CAIRO
-  if (FRAME_TOOLTIP_P (f) && ! FRAME_VISIBLE_P (f))
+  if (! NILP (tip_frame) && XFRAME (tip_frame) == f
+      && ! FRAME_VISIBLE_P (f))
     return;
 
   if (! FRAME_CR_SURFACE (f))
@@ -7838,9 +7839,11 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
     case UnmapNotify:
       /* Redo the mouse-highlight after the tooltip has gone.  */
-      if (dpyinfo->x_tooltip_frame
-         && FRAME_X_WINDOW (dpyinfo->x_tooltip_frame) == event->xunmap.window)
-       x_redo_mouse_highlight (dpyinfo);
+      if (event->xunmap.window == tip_window)
+        {
+          tip_window = 0;
+          x_redo_mouse_highlight (dpyinfo);
+        }
 
       f = x_top_window_to_frame (dpyinfo, event->xunmap.window);
       if (f)           /* F may no longer exist if
@@ -8430,7 +8433,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
 #ifdef USE_X_TOOLKIT
           /* Tip frames are pure X window, set size for them.  */
-          if (FRAME_TOOLTIP_P (f))
+          if (! NILP (tip_frame) && XFRAME (tip_frame) == f)
             {
               if (FRAME_PIXEL_HEIGHT (f) != configureEvent.xconfigure.height
                   || FRAME_PIXEL_WIDTH (f) != configureEvent.xconfigure.width)
@@ -9611,7 +9614,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 (!FRAME_TOOLTIP_P (f))
+      if (NILP (tip_frame) || XFRAME (tip_frame) != f)
        {
          adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
                             FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 3,
@@ -10686,7 +10689,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 (!FRAME_TOOLTIP_P (f))
+  if (NILP (tip_frame) || XFRAME (tip_frame) != f)
     {
       int text_width, text_height;
 
@@ -11337,8 +11340,6 @@ 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);