return 0;
}
-/* Like x_any_window_to_frame but only try to find tooltip frames. */
+/* Like x_any_window_to_frame but only try to find tooltip frames.
+
+ If wdesc is a toolkit tooltip without an associated frame, set
+ UNRELATED_TOOLTIP_P to true. Otherwise, set it to false. */
static struct frame *
x_tooltip_window_to_frame (struct x_display_info *dpyinfo,
- Window wdesc)
+ Window wdesc, bool *unrelated_tooltip_p)
{
Lisp_Object tail, frame;
struct frame *f;
+#ifdef USE_GTK
+ GtkWidget *widget;
+ GdkWindow *tooltip_window;
+#endif
+
+ *unrelated_tooltip_p = false;
FOR_EACH_FRAME (tail, frame)
{
&& FRAME_DISPLAY_INFO (f) == dpyinfo
&& FRAME_X_WINDOW (f) == wdesc)
return f;
+
+#ifdef USE_GTK
+ if (FRAME_X_OUTPUT (f)->ttip_window)
+ widget = GTK_WIDGET (FRAME_X_OUTPUT (f)->ttip_window);
+ else
+ widget = NULL;
+
+ if (widget)
+ tooltip_window = gtk_widget_get_window (widget);
+ else
+ tooltip_window = NULL;
+
+ if (tooltip_window
+ && (gdk_x11_window_get_xid (tooltip_window) == wdesc))
+ {
+ *unrelated_tooltip_p = true;
+ break;
+ }
+#endif
}
return NULL;
{
struct frame *f1, *maybe_tooltip;
struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (*fp);
+ bool unrelated_tooltip;
block_input ();
&& (EQ (track_mouse, Qdrag_source)
|| EQ (track_mouse, Qdropping)))
{
- maybe_tooltip = x_tooltip_window_to_frame (dpyinfo, child);
+ maybe_tooltip = x_tooltip_window_to_frame (dpyinfo, child,
+ &unrelated_tooltip);
- if (maybe_tooltip)
+ if (maybe_tooltip || unrelated_tooltip)
child = x_get_window_below (dpyinfo->display, child,
parent_x, parent_y, &win_x,
&win_y);