Subject: Re: bug#57261: 29.0.50; X protocol error: XI_BadDevice (invalid Device parameter) on protocol request 131

From: Robert Pluim <[email-masked]>
Date: Wed, 17 Aug 2022 16:43:26 +0200

>>>>> On Wed, 17 Aug 2022 17:31:47 +0300, Jean Louis <[email-masked]> said:

    Jean> I could not start X version of Emacs at all.
    Jean> I am on latest git version.

    Jean> What worked is `emacs -nw --bg-daemon':

    Jean> but Emacs is not starting on X now.

Does this help:

diff --git a/src/xterm.c b/src/xterm.c
index a40440e0da..a329ca59d0 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -27654,6 +27654,8 @@ xi_select_hierarchy_events (struct x_display_info *dpyinfo)
   memset (m, 0, l);
   mask.mask_len = l;
 
+  mask.deviceid = XIAllDevices;
+
   XISetMask (m, XI_PropertyEvent);
   XISetMask (m, XI_HierarchyChanged);
   XISetMask (m, XI_DeviceChanged);

Robert
--