unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Yikai Zhao <yikai@z1k.dev>
To: Pip Cet <pipcet@protonmail.com>
Cc: "Gerd Möllmann" <gerd.moellmann@gmail.com>,
	"Helmut Eller" <eller.helmut@gmail.com>,
	74590@debbugs.gnu.org
Subject: bug#74590: 31.0.50 [scratch/igc branch]; key input sometimes skip fcitx input method preedit box
Date: Wed, 4 Dec 2024 12:55:04 +0800	[thread overview]
Message-ID: <CANMyjpi10gYkHXkGRhLeGnVAKLSZuscA30AMjGLeMuHsHPwsng@mail.gmail.com> (raw)
In-Reply-To: <878qsykq4i.fsf@protonmail.com>

Here attached the relevant output of "xscope".

t=116.64 is approximately the timestamp of a correct keypress (that
goes to fcitx);
t=116.83 is approximately the timestamp of an incorrect keypress (that
goes to emacs).

I just realized that you mentioned the x11trace tool. I will also try
to reproduce with x11trace later.

---

116.64:                      120 bytes <-- X11 Server 3 (pid 3359 Xorg)
                     ..............EVENT: GenericEvent
                               extension: XInputExtension
                              event type: 0002
                                    data: (27)
116.64: Client 3 -->  140 bytes
     ............REQUEST: ChangeProperty
                    mode: Replace
                  window: WIN 06e000b4
                property: <_NET_WM_USER_TIME>
                    type: <CARDINAL>
                  format: 20
                    data: 4b367e4c
     ............REQUEST: ChangeProperty
                    mode: Append
                  window: WIN 0020015a
                property: <_client10>
                    type: <STRING>
                  format: 08
                    data:
"<^@^J^@`^@{^@^@^@^@^@^B6]\254L~6K\373^A^@^@\265^@\340^F^@^@^@^@\200^F^H^B,^Bb^A^@^@^A^@"
     ............REQUEST: SendEvent
               propagate: False
             destination: WIN 0020015a
              event-mask: 0
                   event:                      ..............EVENT:
ClientMessage
                                  format: 20
                                  window: WIN 0020015a
                                    type: <_XIM_PROTOCOL>
                                    data: 2c 00 00 00 ec 02

116.64:                       32 bytes <-- X11 Server 3 (pid 3359 Xorg)
                     ..............EVENT: PropertyNotify
                                  window: WIN 06e000b4
                                    atom: <_NET_WM_USER_TIME>
                                    time: TIM 4b367e51
                                   state: NewValue
116.70:                      120 bytes <-- X11 Server 3 (pid 3359 Xorg)
                     ..............EVENT: GenericEvent
                               extension: XInputExtension
                              event type: 0003
                                    data: (27)
116.71: Client 3 -->   20 bytes
     ............REQUEST: InternAtom
          only-if-exists: False
                    name: "_client11"
116.71:                       32 bytes <-- X11 Server 3 (pid 3359 Xorg)
                     ..............REPLY: InternAtom
                                    atom: <_client11>
116.71: Client 3 -->  112 bytes
     ............REQUEST: ChangeProperty
                    mode: Append
                  window: WIN 0020015a
                property: <_client11>
                    type: <STRING>
                  format: 08
                    data:
"<^@^J^@`^@{^@^@^@^@^@^C6`\254\221~6K\373^A^@^@\265^@\340^F^@^@^@^@\200^F^H^B,^Bb^A^@^@^A^@"
     ............REQUEST: SendEvent
               propagate: False
             destination: WIN 0020015a
              event-mask: 0
                   event:                      ..............EVENT:
ClientMessage
                                  format: 20
                                  window: WIN 0020015a
                                    type: <_XIM_PROTOCOL>
                                    data: 2c 00 00 00 ed 02

116.71:                       32 bytes <-- X11 Server 3 (pid 3359 Xorg)
                     ..............EVENT: ClientMessage
                                  source: SendEvent
                                  format: 20
                                  window: WIN 06e0001c
                                    type: <_XIM_PROTOCOL>
                                    data: 2c 00 00 00 ed fb
116.71: Client 3 -->   24 bytes
     ............REQUEST: GetProperty
                  delete: True
                  window: WIN 06e0001c
                property: ATM 0000fbed
                    type: AnyPropertyType
             long-offset: 00000000
116.71:                       76 bytes <-- X11 Server 3 (pid 3359 Xorg)
                     ..............REPLY: GetProperty
                                  format: 08
                                    type: <STRING>
                             bytes-after: 00000000
                                   value:
"<^@^J^@`^@{^@^A^@^@^@^C6`\254\221~6K\373^A^@^@\265^@\340^F^@^@^@^@^@^@^@^@,^Bb^A^@^@^@^@"
116.83:                      120 bytes <-- X11 Server 3 (pid 3359 Xorg)
                     ..............EVENT: GenericEvent
                               extension: XInputExtension
                              event type: 0002
                                    data: (27)
116.83: Client 3 -->  164 bytes
     ............REQUEST: ChangeProperty
                    mode: Replace
                  window: WIN 06e000b4
                property: <_NET_WM_USER_TIME>
                    type: <CARDINAL>
                  format: 20
                    data: 4b367f10
     ............REQUEST: SendEvent
               propagate: False
             destination: WIN 0020015a
              event-mask: 0
                   event:                      ..............EVENT:
ClientMessage
                                  format: 08
                                  window: WIN 0020015a
                                    type: <_XIM_PROTOCOL>
                                    data: 3e 00 01 00 60 00

     ............REQUEST: ChangeProperty
                    mode: Append
                  window: WIN 0020015a
                property: <_client12>
                    type: <STRING>
                  format: 08
                    data: "6^@^E^@`^@{^@^L^@^@^@^F^@^H^@^P^@^D^@,^@\256^A"
     ............REQUEST: SendEvent
               propagate: False
             destination: WIN 0020015a
              event-mask: 0
                   event:                      ..............EVENT:
ClientMessage
                                  format: 20
                                  window: WIN 0020015a
                                    type: <_XIM_PROTOCOL>
                                    data: 18 00 00 00 ee 02

116.83:                       32 bytes <-- X11 Server 3 (pid 3359 Xorg)
                     ..............EVENT: PropertyNotify
                                  window: WIN 06e000b4
                                    atom: <_NET_WM_USER_TIME>
                                    time: TIM 4b367f10
                                   state: NewValue
116.83:                       32 bytes <-- X11 Server 3 (pid 3359 Xorg)
                     ..............EVENT: ClientMessage
                                  source: SendEvent
                                  format: 08
                                  window: WIN 06e0001c
                                    type: <_XIM_PROTOCOL>
                                    data: 37 00 01 00 60 00
116.83: Client 3 -->   92 bytes
     ............REQUEST: ChangeProperty
                    mode: Append
                  window: WIN 0020015a
                property: <_client13>
                    type: <STRING>
                  format: 08
                    data: "6^@^E^@`^@{^@^L^@^@^@^F^@^H^@^P^@^D^@,^@\256^A"
     ............REQUEST: SendEvent
               propagate: False
             destination: WIN 0020015a
              event-mask: 0
                   event:                      ..............EVENT:
ClientMessage
                                  format: 20
                                  window: WIN 0020015a
                                    type: <_XIM_PROTOCOL>
                                    data: 18 00 00 00 ef 02

116.83:                       32 bytes <-- X11 Server 3 (pid 3359 Xorg)
                     ..............EVENT: ClientMessage
                                  source: SendEvent
                                  format: 08
                                  window: WIN 06e0001c
                                    type: <_XIM_PROTOCOL>
                                    data: 37 00 01 00 60 00
116.83: Client 3 -->  324 bytes
     ............REQUEST: SetClipRectangles
                ordering: UnSorted
                      gc: GXC 06e006c5
           clip-x-origin: 0
           clip-y-origin: 0
              rectangles: (1)
     ............REQUEST: RenderRequest
           RENDERREQUEST: RenderFillRectangles
                      op: Src
                    dest: PICTURE 06e000fc
                   color: COLOR r:fdfd g:f6f6 b:e3e3 a:ffff
              rectangles: (1)
     ............REQUEST: RenderRequest
           RENDERREQUEST: RenderCompositeGlyphs8
                      op: Over
                  source: PICTURE 06e006cc
                    dest: PICTURE 06e000fc
             mask format: None
                glyphset: GLYPHSET 06e00104
                   x-src: 44
                   y-src: 424
                   items:
                 delta x: 44
                 delta y: 424
     glyph item 8 string: "I"
     ............REQUEST: ChangeGC
                      gc: GXC 06e006c5
              value-mask: clip-mask
              value-list:
                   clip-mask: None
     ............REQUEST: SetClipRectangles
                ordering: UnSorted
                      gc: GXC 06e006c5
           clip-x-origin: 0
           clip-y-origin: 0
              rectangles: (1)
     ............REQUEST: RenderRequest
           RENDERREQUEST: RenderFillRectangles
                      op: Src
                    dest: PICTURE 06e000fc
                   color: COLOR r:fdfd g:f6f6 b:e3e3 a:ffff
              rectangles: (1)
     ............REQUEST: ChangeGC
                      gc: GXC 06e006c5
              value-mask: clip-mask
              value-list:
                   clip-mask: None
     ............REQUEST: SetClipRectangles
                ordering: UnSorted
                      gc: GXC 06e0012f
           clip-x-origin: 0
           clip-y-origin: 0
              rectangles: (1)
     ............REQUEST: RenderRequest
           RENDERREQUEST: RenderFillRectangles
                      op: Src
                    dest: PICTURE 06e000fc
                   color: COLOR r:6565 g:7b7b b:8383 a:ffff
              rectangles: (1)
     ............REQUEST: ChangeGC
                      gc: GXC 06e0012f
              value-mask: clip-mask
              value-list:
                   clip-mask: None
     ............REQUEST: ChangeProperty
                    mode: Append
                  window: WIN 0020015a
                property: <_client14>
                    type: <STRING>
                  format: 08
                    data: "6^@^E^@`^@{^@^L^@^@^@^F^@^H^@^P^@^D^@5^@\256^A"
     ............REQUEST: SendEvent
               propagate: False
             destination: WIN 0020015a
              event-mask: 0
                   event:                      ..............EVENT:
ClientMessage
                                  format: 20
                                  window: WIN 0020015a
                                    type: <_XIM_PROTOCOL>
                                    data: 18 00 00 00 f3 02

116.84:                       32 bytes <-- X11 Server 3 (pid 3359 Xorg)
                     ..............EVENT: ClientMessage
                                  source: SendEvent
                                  format: 08
                                  window: WIN 06e0001c
                                    type: <_XIM_PROTOCOL>
                                    data: 37 00 01 00 60 00
116.84: Client 3 -->   16 bytes
     ............REQUEST: DOUBLE-BUFFER-Request
            minor opcode: 03
                    data: (3)
116.90:                      120 bytes <-- X11 Server 3 (pid 3359 Xorg)
                     ..............EVENT: GenericEvent
                               extension: XInputExtension
                              event type: 0003
                                    data: (27)
116.90: Client 3 -->  112 bytes
     ............REQUEST: ChangeProperty
                    mode: Append
                  window: WIN 0020015a
                property: <_client15>
                    type: <STRING>
                  format: 08
                    data:
"<^@^J^@`^@{^@^@^@^@^@^C^Zw\254Q<del>6K\373^A^@^@\265^@\340^F^@^@^@^@\200^F^H^B,^Bb^A^@^@^A^@"
     ............REQUEST: SendEvent
               propagate: False
             destination: WIN 0020015a
              event-mask: 0
                   event:                      ..............EVENT:
ClientMessage
                                  format: 20
                                  window: WIN 0020015a
                                    type: <_XIM_PROTOCOL>
                                    data: 2c 00 00 00 f5 02

116.90:                       32 bytes <-- X11 Server 3 (pid 3359 Xorg)
                     ..............EVENT: ClientMessage
                                  source: SendEvent
                                  format: 20
                                  window: WIN 06e0001c
                                    type: <_XIM_PROTOCOL>
                                    data: 2c 00 00 00 ee fb
116.90: Client 3 -->   24 bytes
     ............REQUEST: GetProperty
                  delete: True
                  window: WIN 06e0001c
                property: ATM 0000fbee
                    type: AnyPropertyType
             long-offset: 00000000
116.90:                       76 bytes <-- X11 Server 3 (pid 3359 Xorg)
                     ..............REPLY: GetProperty
                                  format: 08
                                    type: <STRING>
                             bytes-after: 00000000
                                   value:
"<^@^J^@`^@{^@^A^@^@^@^C^Zw\254Q<del>6K\373^A^@^@\265^@\340^F^@^@^@^@^@^@^@^@,^Bb^A^@^@^@^@"
116.90: Client 3 -->   44 bytes
     ............REQUEST: SendEvent
               propagate: False
             destination: WIN 0020015a
              event-mask: 0
                   event:                      ..............EVENT:
ClientMessage
                                  format: 08
                                  window: WIN 0020015a
                                    type: <_XIM_PROTOCOL>
                                    data: 3e 00 01 00 60 00

116.93:                      120 bytes <-- X11 Server 3 (pid 3359 Xorg)
                     ..............EVENT: GenericEvent
                               extension: XInputExtension
                              event type: 0002
                                    data: (27)
116.93: Client 3 -->  140 bytes
     ............REQUEST: ChangeProperty
                    mode: Replace
                  window: WIN 06e000b4
                property: <_NET_WM_USER_TIME>
                    type: <CARDINAL>
                  format: 20
                    data: 4b367f73
     ............REQUEST: ChangeProperty
                    mode: Append
                  window: WIN 0020015a
                property: <_client16>
                    type: <STRING>
                  format: 08
                    data:
"<^@^J^@`^@{^@^@^@^@^@^B^^{\254s<del>6K\373^A^@^@\265^@\340^F^@^@^@^@\200^F^H^B,^Bb^A^@^@^A^@"
     ............REQUEST: SendEvent
               propagate: False
             destination: WIN 0020015a
              event-mask: 0
                   event:                      ..............EVENT:
ClientMessage
                                  format: 20
                                  window: WIN 0020015a
                                    type: <_XIM_PROTOCOL>
                                    data: 2c 00 00 00 f6 02

116.93:                       32 bytes <-- X11 Server 3 (pid 3359 Xorg)
                     ..............EVENT: PropertyNotify
                                  window: WIN 06e000b4
                                    atom: <_NET_WM_USER_TIME>
                                    time: TIM 4b367f73
                                   state: NewValue

On Tue, Dec 3, 2024 at 12:26 AM Pip Cet <pipcet@protonmail.com> wrote:
>
> "Yikai Zhao" <yikai@z1k.dev> writes:
>
> > I have reproduced the issue with your patch, here's the relevant log:
>
> Thank you! So it seems we call XFilterEvent correctly but it incorrectly
> indicates that the keypress (event 2) should be handled by Emacs rather
> than the input method. That's rather puzzling, particularly since
> subsequent calls to XFilterEvent return 1, indicating that the key
> release is handled by the input method.
>
> I'm pretty much stumped at this point. It might be a timing difference
> between the MPS and non-MPS builds, but I think it's more likely to be
> a bug in our MPS code.
>
> > Please let me know if there's any other info I can provide.
>
> Well, you already tried setting x-gtk-use-native-input to t :-)
>
> One thing you could try is to run a full x11trace of the Emacs session
> and see whether anything unusual is in there. But that's not guaranteed
> to yield any results.
>
> Pip
>





      parent reply	other threads:[~2024-12-04  4:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-28 13:18 bug#74590: 31.0.50 [scratch/igc branch]; key input sometimes skip fcitx input method preedit box Yikai Zhao
2024-11-28 13:32 ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-29  4:26   ` Yikai Zhao
2024-11-29  5:21     ` Gerd Möllmann
2024-11-29  5:55       ` Gerd Möllmann
2024-11-30 10:39         ` Helmut Eller
2024-11-30 10:55           ` Gerd Möllmann
2024-11-30 16:37             ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01  6:04               ` Gerd Möllmann
2024-12-01  7:33                 ` Gerd Möllmann
2024-12-01 10:08                   ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 11:30                     ` Gerd Möllmann
2024-12-02  8:58                     ` Yikai Zhao
2024-12-02 10:06                       ` Yikai Zhao
2024-12-02  8:56               ` Yikai Zhao
2024-12-02 16:26                 ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-02 16:51                   ` Eli Zaretskii
2024-12-04  4:55                   ` Yikai Zhao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANMyjpi10gYkHXkGRhLeGnVAKLSZuscA30AMjGLeMuHsHPwsng@mail.gmail.com \
    --to=yikai@z1k.dev \
    --cc=74590@debbugs.gnu.org \
    --cc=eller.helmut@gmail.com \
    --cc=gerd.moellmann@gmail.com \
    --cc=pipcet@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).