diff options
| author | Po Lu | 2022-02-13 11:29:44 +0800 |
|---|---|---|
| committer | Po Lu | 2022-02-13 11:29:44 +0800 |
| commit | 79fd672dfc1a66a5bce58f7de330785c0b09ade0 (patch) | |
| tree | c02ea4387e3156b1e8927b153bc9e575294677dd /src | |
| parent | 0b3692251ce4767654aa57e1d7a9c151801414a6 (diff) | |
| download | emacs-79fd672dfc1a66a5bce58f7de330785c0b09ade0.tar.gz emacs-79fd672dfc1a66a5bce58f7de330785c0b09ade0.zip | |
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')
| -rw-r--r-- | src/xwidget.c | 19 |
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; | |||
| 62 | #ifdef USE_GTK | 62 | #ifdef USE_GTK |
| 63 | #ifdef HAVE_X_WINDOWS | 63 | #ifdef HAVE_X_WINDOWS |
| 64 | static Lisp_Object x_window_to_xwv_map; | 64 | static Lisp_Object x_window_to_xwv_map; |
| 65 | #if WEBKIT_CHECK_VERSION (2, 34, 0) | ||
| 66 | static Lisp_Object dummy_tooltip_string; | ||
| 67 | #endif | ||
| 65 | #endif | 68 | #endif |
| 66 | static gboolean offscreen_damage_event (GtkWidget *, GdkEvent *, gpointer); | 69 | static gboolean offscreen_damage_event (GtkWidget *, GdkEvent *, gpointer); |
| 67 | static void synthesize_focus_in_event (GtkWidget *); | 70 | static void synthesize_focus_in_event (GtkWidget *); |
| @@ -1731,6 +1734,17 @@ xw_maybe_synthesize_crossing (struct xwidget_view *view, | |||
| 1731 | bool nonlinear_p; | 1734 | bool nonlinear_p; |
| 1732 | bool retention_flag; | 1735 | bool retention_flag; |
| 1733 | 1736 | ||
| 1737 | #if WEBKIT_CHECK_VERSION (2, 34, 0) | ||
| 1738 | /* Work around a silly bug in WebKitGTK+ that tries to make tooltip | ||
| 1739 | windows transient for our offscreen window. */ | ||
| 1740 | int tooltip_width, tooltip_height; | ||
| 1741 | struct x_output *output = FRAME_X_OUTPUT (view->frame); | ||
| 1742 | |||
| 1743 | if (!output->ttip_widget) | ||
| 1744 | xg_prepare_tooltip (view->frame, dummy_tooltip_string, | ||
| 1745 | &tooltip_width, &tooltip_height); | ||
| 1746 | #endif | ||
| 1747 | |||
| 1734 | toplevel = gtk_widget_get_window (XXWIDGET (view->model)->widgetwindow_osr); | 1748 | toplevel = gtk_widget_get_window (XXWIDGET (view->model)->widgetwindow_osr); |
| 1735 | retention_flag = false; | 1749 | retention_flag = false; |
| 1736 | 1750 | ||
| @@ -3931,6 +3945,11 @@ syms_of_xwidget (void) | |||
| 3931 | x_window_to_xwv_map = CALLN (Fmake_hash_table, QCtest, Qeq); | 3945 | x_window_to_xwv_map = CALLN (Fmake_hash_table, QCtest, Qeq); |
| 3932 | 3946 | ||
| 3933 | staticpro (&x_window_to_xwv_map); | 3947 | staticpro (&x_window_to_xwv_map); |
| 3948 | |||
| 3949 | #if WEBKIT_CHECK_VERSION (2, 34, 0) | ||
| 3950 | dummy_tooltip_string = build_string (""); | ||
| 3951 | staticpro (&dummy_tooltip_string); | ||
| 3952 | #endif | ||
| 3934 | #endif | 3953 | #endif |
| 3935 | } | 3954 | } |
| 3936 | 3955 | ||