From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#54436: 28.0.91; Only every second mouse wheel scroll is registered Date: Sat, 19 Mar 2022 08:52:43 +0800 Message-ID: <87ee2yn4pw.fsf@yahoo.com> References: Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25032"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: 54436@debbugs.gnu.org To: Urban Duh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 19 01:54:32 2022 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 1nVNMV-0006Mu-9y for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Mar 2022 01:54:31 +0100 Original-Received: from localhost ([::1]:60210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVNMT-0000nJ-VZ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Mar 2022 20:54:29 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36928) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVNM2-0000l9-Ec for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2022 20:54:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36616) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nVNM2-0001wF-6D for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2022 20:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nVNM2-0003IO-1M for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2022 20:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Mar 2022 00:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54436 X-GNU-PR-Package: emacs Original-Received: via spool by 54436-submit@debbugs.gnu.org id=B54436.164765118512595 (code B ref 54436); Sat, 19 Mar 2022 00:54:01 +0000 Original-Received: (at 54436) by debbugs.gnu.org; 19 Mar 2022 00:53:05 +0000 Original-Received: from localhost ([127.0.0.1]:58746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVNL7-0003H5-GE for submit@debbugs.gnu.org; Fri, 18 Mar 2022 20:53:05 -0400 Original-Received: from sonic306-22.consmr.mail.ne1.yahoo.com ([66.163.189.84]:37606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVNL4-0003GX-Cl for 54436@debbugs.gnu.org; Fri, 18 Mar 2022 20:53:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1647651175; bh=chLM3lnG7itlvjoSEyjj3IUvSfLd3C7I+O4uuziN2+s=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=LIZLPNXk4hIe6hpFLxhd19VcvINWUjcJoQS2QldDa8urHRIUGu4yaVsDU7idra25rGciQ3fd0QyP8sXRNyG2ULM2z4xwz5E/u6p/wmIoNnLmZtez1Ro06NXg6MxvKULf5HlcvkintvO/TL0MhKYR9/lL95mkSZQusVFcUyPeUBrcZ8/CQHWXQIJm189G+A21L7m09Kiv+Z/XM77isdy/Zxu7XhTsk0gO+jVL8ImVnNcs9ttnyCEQReY3ekqDNXoKXoX/yvwuN4zZEozlWW1rNsA6qIaCvu7/bzdmush+7KPUN2znFupNkkq4V/lpqFev49MwK60IgT/2HkiVt96+eA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1647651175; bh=CrpljGiA30Xp5qaNhAPycXSoVOnTD0w1o9qDCHrwnkm=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=MUXgjHELwCu97CioUrTfRNkq6NWvNOHoqAoSF+APL4fwkfrtBi1lnUW9fRQjqzkc+s103aiVPM9xXqjC4EBlCk+Vesuz8mBufaPLyvvBok4MlpDddp+KqqUqca2N2mtKXxajxK32XEhfNVhG/fcRR3jA8dyUqAxnV3/nsOmWwoxUHzWb4Iz4SoxqF85BqQWd7eU4G1BP7kITPyN9UDZGBrs6LJJE+Z96XvsbsX4j1B9jjZwlP4McvDjvozKn/xwJJkDfmtoCjnSExug1x5k1ezliKMTgn0ONIMPPLEpNiRGLiV6+nvNkmDqv+XSxUn6UP7LkHEx2vsv83vdWPROZ8w== X-YMail-OSG: JOotuNcVM1lZ5MakhtNmZTxMqse13GDXlCZw8YIYhij6zKx1j5euYr3EjXU_t8m Zo8FFPSuAlLTVnWQCFa50Uffh5qiXvWdWFN85kf00AStHPqI3PeG80gaWmGWwXK1PpHzD_YK4n6U lepmb8wgi0w4SNtqY3LRYv3fVQjB4NmZUvWYwf2bZZZCSxuXWWvQmf6TYok4c9hIQS2rCLH18imo Y4UE9kvWl4Tz3uOX0VgtwSFV5RS6LYWhz.kvuMttZpy3j1p786PiTFh_ZBx11pcRM4t6o_wE9_Gq Ch38BRoZWSCXu9oayReH0iPzwOVdebe23M45eZP7JSOMcH.4WWDtVel67tJA0CDFVLNjhyvGgM2b XRORKaRS.o3Vu94mYHX0xAjXZwaqjl7RkrXcecWn_piXcvH1vSypbcrzT.NY3.6kJLd3SIXGUW_6 QgiIFERS8NdaXcPlpQgaxgW.9jql.UB8.nryDCJaOFC65oYvSgbDZnbHGL3Pd48c9W6lU9OiVhWK gpBneAtHuZXFKRCT82sCe36Bdd_3hCemmL6X.poS3eUCCg8zQ7hcuCLHkYUnh8.e9TaExF2UAOmE g6ktxazH3FFPxhUbHJdg1_vJn22NA5j7dVO7EA6fucD9dw09NBeAN_XaMVAegAWMCIYTUtGVxbcP BRGuI8bKMR1BC5tTAiBvkFIEF3b13mwJMJn8pUVm69I6QWJM03UdKuu2wFs545wHxbsx_3rX4nxz ntxC1OGblWe2YlnMBLoWFmjuTcjYUHsc5qBtIFQCeli40SkU.JODIcovMd9gsiHGwGmejOQWRWWq wQl3azynVWxz96QNcI0L3gkuqphYqw.MkVQWVmj7u2 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Sat, 19 Mar 2022 00:52:55 +0000 Original-Received: by kubenode516.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID bc6ad35b9e356cd684dac6b083f4ad7c; Sat, 19 Mar 2022 00:52:51 +0000 (UTC) In-Reply-To: (Urban Duh's message of "Thu, 17 Mar 2022 11:47:50 +0100") X-Mailer: WebService/1.1.19894 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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" Xref: news.gmane.io gmane.emacs.bugs:228575 Archived-At: Urban Duh writes: > Only every second mouse wheel scroll move is registered, instead of all of > them. This happens when scrolling the text and also when using > keybindings (i. e. C-h is activated only after scrolling > twice). The two scrolls do not need to be in quick succession, I can > scroll once (and nothing happens), wait for a long time and then the > next scroll is registered. > > Currently using Doom Emacs on Emacs 28.0.91 with native compilation on > Arch Linux running GNOME on Xorg, but the same thing can be reproduced > in Emacs 29.0.50, on Wayland and in other WMs (I tried Qtile). The same > issue exists on Emacs without any customizations (just installing > emacs-git or emacs-gcc-wayland-devel-bin from AUR without Doom). Emacs > 27 (package emacs from Arch Extra repository) does not have this issue > and works fine. > > I am new to Emacs, so I'm not completely sure what other info I should > provide, so do not hesitate to contact me for more info. Are you running PGTK? It's not present in the official pretests of Emacs 28, but several very irresponsible individuals are haphazardly merging the code from Emacs 29 into Emacs 28, and then distributing packages labeled "enhanced or "wayland" on platforms such as the AUR. If you're running X, don't use PGTK. Here's the problem in this specific case: GTK uses the X input extension to detect mouse wheel movement, which relies on keeping the mouse wheel "valuators" in synch with the X server, and calculating the difference between GTK's own record of the valuator values and the X server's reported values every time a valuator changes. This is made complicated by the fact that an X window does not get events to update the valuators unless it has the grab, or the mouse pointer is on top of it. So, every time the mouse enters a window, GTK marks the valuator as invalid, after which two consecutive wheel events are required before any more wheel movement will be recorded: one to obtain the current value of the valuator, and another one so that the distance the wheel has moved can be calculated. Selecting for input extension events results in the corresponding core event mask being deactivated on the window. Some very smart window managers select for core wheel events (which are just button events) on the WM frame window, or the root window, and since there is no core button event mask on the Emacs frame window when GTK is using the input extension, the button events representing wheel movement get propagated up to the frame (or root) window, and that causes a grab to be activated and then deactivated, generating incorrect entry events, which then cause GTK to invalidate its own record of the scroll valuators, and causes wheel movement to be ignored at random. The solution is to use the official build of Emacs 28, and to not use PGTK on X Windows if you want to run Emacs 29.