[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 79fd672dfc: Work around tooltip bug on new versions of WebKitGTK
From: |
Po Lu |
Subject: |
master 79fd672dfc: Work around tooltip bug on new versions of WebKitGTK |
Date: |
Sat, 12 Feb 2022 22:30:59 -0500 (EST) |
branch: master
commit 79fd672dfc1a66a5bce58f7de330785c0b09ade0
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
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.
---
src/xwidget.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/src/xwidget.c b/src/xwidget.c
index fc6ba2c633..bfee80ef3e 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
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 79fd672dfc: Work around tooltip bug on new versions of WebKitGTK,
Po Lu <=