From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#74590: 31.0.50 [scratch/igc branch]; key input sometimes skip fcitx input method preedit box Date: Sun, 01 Dec 2024 07:04:18 +0100 Message-ID: References: <87iks5xayc.fsf@gmail.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="26559"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Yikai Zhao , 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 Sun Dec 01 07:06:12 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 1tHd5v-0006lI-N4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 Dec 2024 07:06:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tHd5o-0003VT-1z; Sun, 01 Dec 2024 01:06:04 -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 1tHd5m-0003VI-T0 for bug-gnu-emacs@gnu.org; Sun, 01 Dec 2024 01:06:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tHd5m-0006yB-JY for bug-gnu-emacs@gnu.org; Sun, 01 Dec 2024 01:06:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=3/+k2vtoHqFfhkO2itIaYmMCSBHoeEoaM0BEH8sQOFo=; b=fndHzw+Yb7oBgvFsoFg2IW5Oe81JTkSCPGhv1oKj4BkmIGhy5ZeDlJl+sGDeRP4IG6DfwgEQmXJX1iRgqi2s+qtLD+v/5vrwBB3ifJBwV+Etjw3k2TKbRudVoKNh8HC47eQZG2HyfVVgDAoampXZS9h37DQcx7a9EDnrO19BImc3x50SOVniswgHoQOeO5OyZLNStG9UMBt3tQMikOON+OoSkGdbq/3kce78rmYQPCQ0Kg/SWQNa2pp3Er7TVP/rpQOzzxxAdZnuxArOXXGwEJx7K7M+AtlCzoVaT3BNXwIyjy8hENv0NUbozjb6NkeWpchVQyUylvC2Xzk9SFAc0w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tHd5m-00039X-DU for bug-gnu-emacs@gnu.org; Sun, 01 Dec 2024 01:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Dec 2024 06:06:02 +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.173303312512064 (code B ref 74590); Sun, 01 Dec 2024 06:06:02 +0000 Original-Received: (at 74590) by debbugs.gnu.org; 1 Dec 2024 06:05:25 +0000 Original-Received: from localhost ([127.0.0.1]:49927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHd5A-00038W-TY for submit@debbugs.gnu.org; Sun, 01 Dec 2024 01:05:25 -0500 Original-Received: from mail-wm1-f50.google.com ([209.85.128.50]:51507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHd58-00038M-HT for 74590@debbugs.gnu.org; Sun, 01 Dec 2024 01:05:23 -0500 Original-Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4349fb56260so27395575e9.3 for <74590@debbugs.gnu.org>; Sat, 30 Nov 2024 22:05:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733033061; x=1733637861; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3/+k2vtoHqFfhkO2itIaYmMCSBHoeEoaM0BEH8sQOFo=; b=NJGbJ8R9YcPr2CWcQcTyOEDvtntk/gQjTuTyr9bzy+w3zMgN8Tjd6S+WPvryqvi4hA K+mTXb3lBjKmivSLaml0eKixPCj59H4peDnvUoDOG0pr/O4M1Gwh8sTfAb9oyP/QTNBS hjcbpvlz4yVr8RdE5fxcDHPV8VxletChQT3PTdljOG5+EK+ABlXbwAeYlRlNTAifUTxS 4PbM/u20kr8VlxN7xbaqnJmOAYtbxq3QKrZe0y5h3K/eyR1deBya9ydovNh1M3pCNYI6 q2jASGngL1wH9H4iQKJpiSMlM/s2iU5F/VzfUUM16rn9a2DsrNLszpMPVzToefT+fG5F PZSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733033061; x=1733637861; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=3/+k2vtoHqFfhkO2itIaYmMCSBHoeEoaM0BEH8sQOFo=; b=aY2DPlmtNsavavnxuM8uiA74XUjtinklp4fISYN7fqx8kds5Hs1atcrJl/S3U5jGj4 LUPPcMG2NEFLHqusr3unrggL7gkAuqs0STJ5338ot0K9uYKyxmSHdiHbwWCUtOLx0R0q hW9Ea5EHDSbPuR0A42DdF+QVU4UepKpIfYldcEnrngsDowwIGbk4CN8zCmoDNnLxWrEw 47A/Fx7WBFb/1vqh34A7ORPn+ouaGhstxeVEZW6kM15tZEsMdkTEFrlbEMTGS86lrHMn h8vPXPNsBImsgbw87WIEibVxAoe/D0DKKIlC9/zZkxhrmq53zJhV+AOXnb1hfEnY6G0Q 6RCQ== X-Forwarded-Encrypted: i=1; AJvYcCV3GdhbPc7MKqpJt+p05/uhf9UvpM3JepIsQ9Chq2isifhO4uhKQcX56F1IllqkLnuivJFUtw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxhlFbGSOOB4t5okzYMwpi3sechL2JUAJyV4ilgpENeXB2ZklYg aaDxP2ErT/mGQWdBPEYSbYvmjandneVmliqpy1ZlcCkDTnetn7Y/G79yvg== X-Gm-Gg: ASbGncvcCTdjAFGeE2OsnfV6lTek5Z+zUMQqNgGBzlJmne5WtXBicd5hV4wqe35q5c3 xdlfJxkcJiV4PrlisnMDej1hWqbmw96E3iFaK+/kZiy7IgH5/rvdsGsBF18OF+mtk2rIe454vMO S4OL8xSAgIXFbo3tWLEdpUPBqxDUt3s+bAonVDAnv3TfCgyy/F+04eNPyreuehJW2oz8NZqE8pA MKkG1m3DfX/ojXrm3o++2HS49IQazMu62XMszjvr+emR9DBDRYpVmOwYwdURhMOtm06TTOK5Q69 s0gmxIccxky0SQAgepWxjsnIst1xpNtvRRL9YKmlpGwltESWx3cCp1OgaA== X-Google-Smtp-Source: AGHT+IE4HGiP2RqBD+khV10V1H7mmKBXyY6xZzNCzDl+Y5fLPVgbgKSAAmEAN7FFBfecT4FIMLxd+A== X-Received: by 2002:a05:600c:1ca7:b0:431:4a5a:f09a with SMTP id 5b1f17b1804b1-434a9decaecmr148930645e9.24.1733033061372; Sat, 30 Nov 2024 22:04:21 -0800 (PST) Original-Received: from pro2 (p200300e0b73e1e0079ddbf8403284f30.dip0.t-ipconnect.de. [2003:e0:b73e:1e00:79dd:bf84:328:4f30]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434aa77d01esm140315045e9.22.2024.11.30.22.04.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Nov 2024 22:04:20 -0800 (PST) In-Reply-To: (Pip Cet's message of "Sat, 30 Nov 2024 16:37:03 +0000") 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:296218 Archived-At: Pip Cet writes: > On Saturday, November 30th, 2024 at 10:55, Gerd M=C3=B6llmann wrote: >> Helmut Eller eller.helmut@gmail.com writes: >>=20 >> > On Fri, Nov 29 2024, Gerd M=C3=B6llmann wrote: >> >=20 >> > > > Not sure if that is used in your build, but in x_display_info (xte= rm.h) >> > > > I see a number of struct frame pointers that are not fixed in fix_= frame, >> > > > starting with >> > > >=20 >> > > > struct frame *x_focus_frame; >> > > >=20 >> > > > And if it's not that display info that is being used, I'd bet a sm= all >> > > > amount that whatever is actually used (pgtk_display_info?) has a s= imilar >> > > > problems. >> > > >=20 >> > > > (Can't fix this myself, sorry, I only have macOS.) >> >=20 >> > I think the x_display_info struct (I guess usually only one exists) is >> > allocated in x_term_init (or pgtk_term_init) with igc_xzalloc_ambig. So >> > theoretically it doesn't need to be traced. >>=20 >>=20 >> Then we're good, sorry for the noise. > > So it turns out X input method handling is somewhat complicated! > > I've tried installing fcitx, but it seems to be working the same here wit= h and without MPS. > > It would help to establish the value of x-gtk-use-native-input, since tha= t determines whether we use the GTK or X method for communicating with fcit= x. > > I've attached a patch which logs some debugging info to stderr > (because displaying messages using X while debugging X code is a bad > idea, IME). If you could apply it and reproduce the output around a > keypress that's handled incorrectly, that might help us track this > down. > > Pip Searching for "closure" and "user_data" turns up this in gtkutil.c: static void xg_im_context_commit (GtkIMContext *imc, gchar *str, gpointer user_data) { struct frame *f =3D get_glib_user_data (user_data); That's a Gtk signal handler, or whatever they are called, which gets set, also in gtkutil.c g_signal_connect_data (G_OBJECT (imc), "commit", G_CALLBACK (xg_im_context_commit), glib_user_data (f), free_glib_user_data, G_CONNECT_DEFAULT); Looks to me like a struct frame * might be "hidden" by this in some Gtk data structure so that it can be passed to the handler at some point. Don't know if that's relevant.