* src/androidfns.c (Fx_show_tip): Set `tip_window' to that of
any reused tooltip frame.
* src/haikufns.c (unwind_create_frame): Return whether the frame
was destroyed, as on X.
(unwind_create_tip_frame, haiku_create_frame, Fx_show_tip):
Synchronize with X.
(do_unwind_create_frame): New function.
(tip_window): Remove unused variable.
* src/nsfns.m (tip_window, unwind_create_tip_frame): Remove
unused variable `tip_window'.
* src/pgtkfns.c (pgtk_create_tip_frame): Rename to
pgtk_create_tip_frame.
(Fx_show_tip): Adjust accordingly. Set `tip_window' to that of
any reused tooltip frame.
* src/w32fns.c (Fx_show_tip):
* src/xfns.c (Fx_show_tip): Set `tip_window' to that of any
reused tooltip frame.
(cherry picked from commit
a4a458ffa4aaeb988ff4b6e6087c44dfdaf40a0b)
/* Creating the tip frame failed. */
return unbind_to (count, Qnil);
}
+ else
+ tip_window = FRAME_ANDROID_WINDOW (XFRAME (tip_frame));
tip_f = XFRAME (tip_frame);
window = FRAME_ROOT_WINDOW (tip_f);
/* The X and Y deltas of the last call to `x-show-tip'. */
Lisp_Object tip_dx, tip_dy;
-/* The window-system window corresponding to the frame of the
- currently visible tooltip. */
-static Window tip_window;
-
/* A timer that hides or deletes the currently visible tooltip when it
fires. */
static Lisp_Object tip_timer;
unblock_input ();
}
-static void
+static Lisp_Object
unwind_create_frame (Lisp_Object frame)
{
struct frame *f = XFRAME (frame);
display is disconnected after the frame has become official, but
before x_create_frame removes the unwind protect. */
if (!FRAME_LIVE_P (f))
- return;
+ return Qnil;
/* If frame is ``official'', nothing to do. */
if (NILP (Fmemq (frame, Vframe_list)))
{
haiku_free_frame_resources (f);
free_glyphs (f);
+ return Qt;
}
+
+ return Qnil;
}
static void
unwind_create_tip_frame (Lisp_Object frame)
{
- unwind_create_frame (frame);
- tip_window = NULL;
- tip_frame = Qnil;
+ Lisp_Object deleted;
+
+ deleted = unwind_create_frame (frame);
+ if (deleted)
+ tip_frame = Qnil;
}
static unsigned long
}
}
+static void
+do_unwind_create_frame (Lisp_Object frame)
+{
+ unwind_create_frame (frame);
+}
+
static Lisp_Object
haiku_create_frame (Lisp_Object parms)
{
FRAME_DISPLAY_INFO (f) = dpyinfo;
/* With FRAME_DISPLAY_INFO set up, this unwind-protect is safe. */
- record_unwind_protect (unwind_create_frame, frame);
+ record_unwind_protect (do_unwind_create_frame, frame);
/* Set the name; the functions to which we pass f expect the name to
be set. */
break;
}
else
- tip_last_parms =
- calln (Qassq_delete_all, parm, tip_last_parms);
+ tip_last_parms
+ = calln (Qassq_delete_all, parm, tip_last_parms);
}
else
- tip_last_parms =
- calln (Qassq_delete_all, parm, tip_last_parms);
+ tip_last_parms
+ = calln (Qassq_delete_all, parm, tip_last_parms);
}
/* Now check if every parameter in what is left of
/* The X and Y deltas of the last call to `x-show-tip'. */
static Lisp_Object tip_dx, tip_dy;
-/* The window-system window corresponding to the frame of the
- currently visible tooltip. */
-static NSWindow *tip_window;
-
/* A timer that hides or deletes the currently visible tooltip when it
fires. */
static Lisp_Object tip_timer;
deleted = unwind_create_frame (frame);
if (EQ (deleted, Qt))
- {
- tip_window = NULL;
- tip_frame = Qnil;
- }
+ tip_frame = Qnil;
}
/* Create a frame for a tooltip on the display described by DPYINFO.
when this happens. */
static Lisp_Object
-x_create_tip_frame (struct pgtk_display_info *dpyinfo, Lisp_Object parms, struct frame *p)
+pgtk_create_tip_frame (struct pgtk_display_info *dpyinfo, Lisp_Object parms, struct frame *p)
{
struct frame *f;
Lisp_Object frame;
/* Create a frame for the tooltip, and record it in the global
variable tip_frame. */
- if (NILP (tip_frame = x_create_tip_frame (FRAME_DISPLAY_INFO (f), parms, f)))
+ if (NILP ((tip_frame = pgtk_create_tip_frame (FRAME_DISPLAY_INFO (f),
+ parms, f))))
/* Creating the tip frame failed. */
return unbind_to (count, Qnil);
}
+ else
+ tip_window = FRAME_X_WINDOW (XFRAME (tip_frame));
tip_f = XFRAME (tip_frame);
window = FRAME_ROOT_WINDOW (tip_f);
return unbind_to (count, Qnil);
}
}
+ else
+ /* Required by X11 drag and drop, and left here in the interests of
+ consistency and in the event drag and drop should be implemented
+ on W32. */
+ tip_window = FRAME_W32_WINDOW (XFRAME (tip_frame));
tip_f = XFRAME (tip_frame);
window = FRAME_ROOT_WINDOW (tip_f);
break;
}
else
- tip_last_parms =
- calln (Qassq_delete_all, parm, tip_last_parms);
+ tip_last_parms
+ = calln (Qassq_delete_all, parm, tip_last_parms);
}
else
- tip_last_parms =
- calln (Qassq_delete_all, parm, tip_last_parms);
+ tip_last_parms
+ = calln (Qassq_delete_all, parm, tip_last_parms);
}
/* Now check if every parameter in what is left of
/* Creating the tip frame failed. */
return unbind_to (count, Qnil);
}
+ else
+ /* Required by X11 drag and drop. */
+ tip_window = FRAME_X_WINDOW (XFRAME (tip_frame));
tip_f = XFRAME (tip_frame);
window = FRAME_ROOT_WINDOW (tip_f);