summaryrefslogtreecommitdiff
path: root/src/xwidget.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-02-13 11:29:44 +0800
committerPo Lu <luangruo@yahoo.com>2022-02-13 11:29:44 +0800
commit79fd672dfc1a66a5bce58f7de330785c0b09ade0 (patch)
treec02ea4387e3156b1e8927b153bc9e575294677dd /src/xwidget.c
parent0b3692251ce4767654aa57e1d7a9c151801414a6 (diff)
downloademacs-79fd672dfc1a66a5bce58f7de330785c0b09ade0.tar.gz
Work around tooltip bug on new versions of WebKitGTK
* src/xwidget.c (dummy_tooltip_string): New variable. (xw_maybe_synthesize_crossing): Call `xg_prepare_tooltip' to disable tooltips on WebKitGTK 2.34 or later. (syms_of_xwidget): Make dummy string.
Diffstat (limited to 'src/xwidget.c')
-rw-r--r--src/xwidget.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/xwidget.c b/src/xwidget.c
index fc6ba2c6335..bfee80ef3ed 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -62,6 +62,9 @@ static uint32_t xwidget_counter = 0;
#ifdef USE_GTK
#ifdef HAVE_X_WINDOWS
static Lisp_Object x_window_to_xwv_map;
+#if WEBKIT_CHECK_VERSION (2, 34, 0)
+static Lisp_Object dummy_tooltip_string;
+#endif
#endif
static gboolean offscreen_damage_event (GtkWidget *, GdkEvent *, gpointer);
static void synthesize_focus_in_event (GtkWidget *);
@@ -1731,6 +1734,17 @@ xw_maybe_synthesize_crossing (struct xwidget_view *view,
bool nonlinear_p;
bool retention_flag;
+#if WEBKIT_CHECK_VERSION (2, 34, 0)
+ /* Work around a silly bug in WebKitGTK+ that tries to make tooltip
+ windows transient for our offscreen window. */
+ int tooltip_width, tooltip_height;
+ struct x_output *output = FRAME_X_OUTPUT (view->frame);
+
+ if (!output->ttip_widget)
+ xg_prepare_tooltip (view->frame, dummy_tooltip_string,
+ &tooltip_width, &tooltip_height);
+#endif
+
toplevel = gtk_widget_get_window (XXWIDGET (view->model)->widgetwindow_osr);
retention_flag = false;
@@ -3931,6 +3945,11 @@ syms_of_xwidget (void)
x_window_to_xwv_map = CALLN (Fmake_hash_table, QCtest, Qeq);
staticpro (&x_window_to_xwv_map);
+
+#if WEBKIT_CHECK_VERSION (2, 34, 0)
+ dummy_tooltip_string = build_string ("");
+ staticpro (&dummy_tooltip_string);
+#endif
#endif
}