From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yikai Zhao Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <87iks5xayc.fsf@gmail.com> <878qsykq4i.fsf@protonmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29555"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gerd =?UTF-8?Q?M=C3=B6llmann?= , Helmut Eller , 74590@debbugs.gnu.org To: Pip Cet Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 04 05:57:28 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tIhS2-0007Uo-JO for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 04 Dec 2024 05:57:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIhRo-0007g1-NT; Tue, 03 Dec 2024 23:57:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIhRm-0007fo-Bg for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2024 23:57:10 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIhRm-0000LR-2U for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2024 23:57:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=Hbjb/PyBk0PgXx7DZ53FM1z5OMvXkqXkE8XVr2rNBco=; b=iUiwVxXER07578t0fOFyj2KtJdyA0lx2JVtUO04z/jkQNcB6EfYJHzMMfR4EcvQ1AikNUkHZ3Tne2GWyW6WplU2EHcGgJX7ppZEJApmIg3E/ueD/u3wSLqOdA8+t+ZPgQrkkXHU/hoBKLwbzgfxFomPKhVvCaNncxxsDQ6LZvNiUE+nU3/qfG1TizoluOMnKzEyVWEP4ACeoDEgWM0gTASvrYEGdTHeogiI4CKEBM9Ysnc5ZgWN3CDMXf5Jy/Flv8GaWURr+tDvMvG2BY0+Yr1aUr59ybC/MvD/eFZ2CmdII7g0aT7VpIbSUNTtDtryo3G7pft7sfXEhTh2mXx7mOA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tIhRd-0001CU-NS for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2024 23:57:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yikai Zhao Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Dec 2024 04:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74590 X-GNU-PR-Package: emacs Original-Received: via spool by 74590-submit@debbugs.gnu.org id=B74590.17332881824547 (code B ref 74590); Wed, 04 Dec 2024 04:57:01 +0000 Original-Received: (at 74590) by debbugs.gnu.org; 4 Dec 2024 04:56:22 +0000 Original-Received: from localhost ([127.0.0.1]:33709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIhQz-0001BG-7X for submit@debbugs.gnu.org; Tue, 03 Dec 2024 23:56:22 -0500 Original-Received: from mail-wr1-f45.google.com ([209.85.221.45]:46292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIhQu-0001B0-TT for 74590@debbugs.gnu.org; Tue, 03 Dec 2024 23:56:19 -0500 Original-Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-385e075255fso3167790f8f.0 for <74590@debbugs.gnu.org>; Tue, 03 Dec 2024 20:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=z1k.dev; s=google; t=1733288116; x=1733892916; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Hbjb/PyBk0PgXx7DZ53FM1z5OMvXkqXkE8XVr2rNBco=; b=BW1XQEtv4Zp83Y5/Et2j6gXVwl36XKWoEPNC2K92zHxmlu9kovMJtS8fpKtSrirPMn ZR1BlM+cVe7XbSSk9zP2zrUw1lzffNTPgA09okWj+LDjqdiYchcVcfqsJ734aV7Tu18h luOZS43/TeprcQN9VNDFseWRdQiCBwZFqlrPaRbPuzcHe4uc4LJkTFDt7Aj/I5VDvxZ4 jmk9CQXJqrBVrJPgqdHdOvF/8/vqRPsJTaKdZ4zdm4zpw2/x3leCEPZPoliR9G77PgMb W6mG7NjskL8LP58ulGYJRxKWJr71drgLBnd0uShP0f1d7Z1YVFF1CUXtI5vjXnKa4Z6x nWIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733288116; x=1733892916; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hbjb/PyBk0PgXx7DZ53FM1z5OMvXkqXkE8XVr2rNBco=; b=N5CMpt7g77henFpp3F7qehfTz3SvILBkm0JL9ayltvOHGF0qdndYWFY2rThIM0HMiC kgh5806gpV5Bvga7HIqgEHFSJRn7E1C8Wu2LltZrCfAZaDs12xH/EvuSu5eBbmIxMxkc dmUmX58XlMD7pZX2E11HCiTbwuqCCPrqOS2jS4Oq+b+TPv8vvzmLXLr/iF8ZGzght1ll +byhqyiGtyxvb+rBO3J2sFW+juanMYFTCVnsVULN9AxaD/yjXFQ87hUGrQUuFbEYvRA/ XDLkgIqE93iKkXzbINiwkWr/m9Ie951jdIvWpn0eCzlk45heepGndQei0mK2iBzQb1fE xM+Q== X-Forwarded-Encrypted: i=1; AJvYcCVNbsqAFT7utRV+/J4ikEEuN731SjWhAsLP7pUx5uia9ypKzQv6nDgtKhQxBmNT+lxvg2qetQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyXUy4wjU/2u+ntO8sc4kvJtrjqTE8ix5XkmQQBNAvntRpOETr+ NflW5951csjK2hAtTboCwMSyIEpLzNWRwPaqR6xfTmRxP2hKs//WMjju0N8HR0LedOLzDt8z8O1 YjBhf/RYTGgF2Rw4/PCxr2VF8GIx02+3/8SCOiA== X-Gm-Gg: ASbGncusDgEBtGE8ecWC9TZ6uDv/jWNMcWHJkodeP0VQhNFv44DDxYos9tQmIkaaB6r cqpTM5PgCT0+3kUEMX5QoEWtECcIIOtctq7Iy+OPh8lkssUBIYxlMRAGFv6SMeiixIw== X-Google-Smtp-Source: AGHT+IEFQw27PHKWhtLVNpql3LVwZaEmP7u1hQnPfpqtF/O7CQ+awKJ7vnTkb0+0RaQKNKvltJrkUajEOJ/sTHCfplc= X-Received: by 2002:a5d:47c9:0:b0:385:e013:73f0 with SMTP id ffacd0b85a97d-385fd42df50mr4667069f8f.59.1733288115999; Tue, 03 Dec 2024 20:55:15 -0800 (PST) In-Reply-To: <878qsykq4i.fsf@protonmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296389 Archived-At: Here attached the relevant output of "xscope". t=3D116.64 is approximately the timestamp of a correct keypress (that goes to fcitx); t=3D116.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: format: 20 data: 4b367e4c ............REQUEST: ChangeProperty mode: Append window: WIN 0020015a property: <_client10> type: 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: 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: 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: 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: 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: 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: 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: format: 08 data: "<^@^J^@`^@{^@^@^@^@^@^C^Zw\254Q6K\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: bytes-after: 00000000 value: "<^@^J^@`^@{^@^A^@^@^@^C^Zw\254Q6K\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: format: 20 data: 4b367f73 ............REQUEST: ChangeProperty mode: Append window: WIN 0020015a property: <_client16> type: format: 08 data: "<^@^J^@`^@{^@^@^@^@^@^B^^{\254s6K\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=E2=80=AFAM Pip Cet wro= te: > > "Yikai Zhao" 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 >