From 080a529f7e9c1a750f39d92f1e8f1e7170d6fb81 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 31 Dec 2021 14:04:40 +0800 Subject: [PATCH] Don't select for gesture events on xwidgets if the server is too old * src/xwidget.c (x_draw_xwidget_glyph_string): Only select for XI gesture events if the server supports XI 2.4 or later. --- src/xwidget.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/xwidget.c b/src/xwidget.c index 4f14152833e..36f216d9399 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -2247,9 +2247,12 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) XISetMask (m, XI_Enter); XISetMask (m, XI_Leave); #ifdef XI_GesturePinchBegin - XISetMask (m, XI_GesturePinchBegin); - XISetMask (m, XI_GesturePinchUpdate); - XISetMask (m, XI_GesturePinchEnd); + if (FRAME_DISPLAY_INFO (s->f)->xi2_version >= 4) + { + XISetMask (m, XI_GesturePinchBegin); + XISetMask (m, XI_GesturePinchUpdate); + XISetMask (m, XI_GesturePinchEnd); + } #endif XISelectEvents (xv->dpy, xv->wdesc, &mask, 1); } -- 2.39.2