Subject: Re: bug#65919: 29.1; build without xinput does not get focused when hovering over window

From: Po Lu <[email-masked]>
Date: Thu, 14 Sep 2023 19:04:20 +0800

Ivan Popovych <[email-masked]> writes:

> Po Lu <[email-masked]> writes:
>
>>
>> OK.  Does the problem vanish if you switch to a no toolkit or GTK 3
>> build?
>
> Build with no toolkit has no issue
>
> Configured using:
>  'configure
>  --prefix=/nix/store/zg0g00l2gyycf1xdl64j89sbnjrif62l-emacs-29.1
>  --disable-build-details --with-modules --with-x-toolkit=no --with-xft
>  --with-cairo --with-native-compilation --with-tree-sitter
>  --with-xinput2'
>
> Build with gtk3 has no issue
>
> Configured using:
>  'configure
>  --prefix=/nix/store/y35rnh7np5m538gmw6qcsr6wcwrw9ls5-emacs-gtk3-29.1
>  --disable-build-details --with-modules --with-x-toolkit=gtk3
>  --with-xft --with-cairo --with-native-compilation --with-tree-sitter
>  --with-xinput2 --with-xwidgets'

Thanks.  I guess the problem arises from the core window focus code used
under X toolkit builds.

Would you please instrument x_focus_changed as follows:

diff --git a/src/xterm.c b/src/xterm.c
index 11ccd5ebdb3..cff9b2537d5 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -12005,6 +12005,8 @@ XTtoggle_invisible_pointer (struct frame *f, bool invisible)
 x_focus_changed (int type, int state, struct x_display_info *dpyinfo,
 		 struct frame *frame, struct input_event *bufp)
 {
+  fprintf (stderr, "x_focus_changed: %d %d %p\n",
+	   type, state, (void *) frame);
   if (type == FocusIn)
     {
       if (dpyinfo->x_focus_event_frame != frame)

and send us whatever is printed to standard output after moving the
pointer within the frame?