From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Possible XInput2 cursor bug ? Date: Sun, 12 Dec 2021 13:27:59 +0800 Message-ID: <871r2i1jfk.fsf@yahoo.com> References: <87ilvzga2h.fsf@yahoo.com> <87a6hbg6ps.fsf@yahoo.com> <20211212.104121.676618396851953065.enometh@meer.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4867"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: emacs-devel@gnu.org To: Madhu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 12 06:29:25 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mwHQL-000178-Ad for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Dec 2021 06:29:25 +0100 Original-Received: from localhost ([::1]:46096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwHQJ-0003vV-Iw for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Dec 2021 00:29:23 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwHPE-0003Ez-FQ for emacs-devel@gnu.org; Sun, 12 Dec 2021 00:28:16 -0500 Original-Received: from sonic315-22.consmr.mail.ne1.yahoo.com ([66.163.190.148]:44808) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwHPB-0001uC-Rz for emacs-devel@gnu.org; Sun, 12 Dec 2021 00:28:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639286892; bh=bsAFtyT3S4lcHkNQMvMivYupUwv+FdF8AOCqTBO2cuM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=Id1cMONvU0n/eAzwFehOkUP9JG+0JFsJfcQFmhgYZ/6v8kwkPtpc96ze0RLsmoHF4que4U6mahW2DcFsWC5LZsSv2R2qqS7n6pWWU8X8cjlVKLO6JODZ2oHirxO3b60QIxrbkaJFfcxkeLCW7pTWIzk50Du/KNCAUenIT4TTv7aKkj5PfVzKgzMkx5uu+Nh8/cP+I6u7EEq2CFgM/9wdOjiy2i3ZFynJyG9o3Gl29xDtIn6luR94253vsFFxLJbH4FhXGV7wqmWuNqkBZeMvfTU5bVGkazgByLiez4RkjjMAO39MeGwFKbyTQu+9vKoxnl6XuJj3dbkAQq4dvhMt9w== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639286892; bh=HZkmZKd5zfQXwDVnxGCShW2A14fQzXUVRybEATo/g1d=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=GbZx9L+LKkOcIB5iTOEzIzvHHOyu9pVYzehbUIJBYZr1pYNyoBKYAJWTftAoKz3dCkdGXm/NvxBnxau9WNKetS7h/RFxhvxwkmwNCzTrRiG2gZ6Gj0QB2ortgyEFAYg3xsaUeI87xdyavnm5V0NtHeiluES73ykO8/M9gnU441hwUdHB/+jZ/rTSFz0MbqA671sLSYhlCHZOA+Mxhb9rgDno8388HLU1txw4lOpfUUEhCfC9KJOhCQtX4iJ52XpqROUWwSG9SGd6qsvfhl3IrQLBRiOCa6GilwwlhfE0+0SVbtz2SiCQINomMBzhF7QSoeHu/aHD7UXvtHSHn+mzyg== X-YMail-OSG: qhRvHpkVM1l8GqpJ0WGaGtigmPtUHEChGULzYfC2Rbpp8Kq1HvGvnz.z3_NK3hV fPrahk7WtnvRN.3IDDXmusxyTCm4zD766pNCE1t7ibbg_iIDRLBnxrQaqiqhAf1AXAxGLqJJLs9A opV7gUZ9_lOhnJ9X1wtMVFxNagoVWpZAwiSQvBT9DvWlyOP4AP8HHR7QnorRvKwEEvy6QOAtDRl2 sMhRvGmzbAqNv_5qF3sMJHdYbrykVs_kGEgf2TNffb44TCzwse1dRAbDLd2PNts4OUeZ9UJixwDK kvSeWYIbDPqcbRMM6scUy4NzQv00X80MZPJ3hZA7Qz.GGhVM6pWlbVyoPF888TbqDd299Q9no_TR oqIUs3M5U2HkwkYsUwFF.6zgjlZlA8bwGWhEKKCzxKV25Or.EmyJVhBfwf_cIdKo0BgAlBOmxXIo jgKhpHeD.L7Kv7S5zq_Nokvc3cMIMV.k7Z7b4k4tNOMO6UCjV_Us08TW9NMpvKUUiGF1SoNO5tr. Xdcsfx6kJJUWlw7e44Xu9piS6ojLconDpj_jkVtn_x6pkIm2wQ9b16.v2tBX57wKZDN_TGRjC6ME .GnxxrmO6SuyAELY6P7azUXM7ocNqTLNlyPFAThm65Ggtc3Xmw2r12WNHICsqh.hPIEVRhtJEDJs Xl.h7HhOsQxebcXZaRsl9oAxjvJtuGTslEkGkOwsZNSKkh_W6vyiS2hp1.IO2e662_6SyA8Wqa.K RfcC2vpgN1c7s612p0lW52QoDUKoW1oKY5Ylcdw4hzrZrzdo6E0MhgtFp379gN3sBEz3N9F6jzz4 Ux.Xj62YGTn3V9mLZsPcTOVQB4WGx9pxk2pDfExwCd X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.ne1.yahoo.com with HTTP; Sun, 12 Dec 2021 05:28:12 +0000 Original-Received: by kubenode515.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID af5e5c63a74bec10fa61464091eb796b; Sun, 12 Dec 2021 05:28:05 +0000 (UTC) In-Reply-To: <20211212.104121.676618396851953065.enometh@meer.net> (Madhu's message of "Sun, 12 Dec 2021 10:41:21 +0530 (IST)") X-Mailer: WebService/1.1.19415 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.190.148; envelope-from=luangruo@yahoo.com; helo=sonic315-22.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:281756 Archived-At: Madhu writes: > Hello, finally got back to this. To recap: the problem is consistently > reproducible only with my own window manager. The window manager does > "focus follows mouse", and (list focus-follows-mouse > mouse-autoselect-window) => (nil nil) You have to tell Emacs how your window manager behaves in this regard by setting `focus-follows-mouse' appropriately. In this case, it should be set to `t'. Please try setting it to that and see if the problem persists. > The test case is evaluating > > (select-frame-set-input-focus (selected-frame)) > ^ C-x C-e FWIW, I can't reproduce it here. > However debugging this with gdb isn't that easy - I can't do it on the > same desktop as I have to switch windows to get at the gdb prompt and > that interferes with the focus. I find the best solution to that problem to be running the program being debugged inside Xephyr (or some other nested X server). > Accessing the gdb prompt from another machine, I see the breakpoint is > hit several times. > If the lisp backtrace involves: > > "x-focus-frame" (0xffffc970) > "select-frame-set-input-focus" (0xffffcbf0) > "eval" (0xffffcde8) > "elisp--eval-last-sexp" (0xffffd0e8) > "eval-last-sexp" (0xffffd430) > "funcall-interactively" (0xffffd428) > "call-interactively" (0xffffd660) > "command-execute" (0xffffd9b8) > > dpyinfo->x_focus_event_frame > > has the value of the single frame. This gets hit 3-4 times. That's expected. > When the backtrace has the form > > #0 x_focus_changed > (type=10, state=1, dpyinfo=0xbb67b0, frame=0xcfe6e0, bufp=0x7fffffffbf50) > at ../../src/xterm.c:4895 > #1 0x00000000004e9d41 in handle_one_xevent > (dpyinfo=0xbb67b0, event=0x7fffffffc5e0, finish=0x7fffffffc5dc, hold_quit=0x > 7fffffffc6d0) at ../../src/xterm.c:9291 > #2 0x00000000004edadf in XTread_socket > (terminal=, hold_quit=0x7fffffffc6d0) > at ../../src/xterm.c:10865 That's a LeaveNotify event, not a GenericEvent. The important question is how many times the code for GenericEvents is called, so could you set a breakpoint here instead, and see if it is called an abnormal amount of times: if (!((xi_event->evtype == XI_Enter || xi_event->evtype == XI_Leave) && (focus_state & FOCUS_EXPLICIT))) ------> x_focus_changed ((xi_event->evtype == XI_Enter || xi_event->evtype == XI_FocusIn ? FocusIn : FocusOut), (xi_event->evtype == XI_Enter || xi_event->evtype == XI_Leave ? FOCUS_IMPLICIT : FOCUS_EXPLICIT), dpyinfo, frame, bufp); > I looked at xev on the window in both cases and could spot no > difference there. No worries there: xev doesn't know about XInput 2, so it can't display anything meaningful. Thanks.