From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrey Listopadov Newsgroups: gmane.emacs.bugs Subject: bug#52685: 29.0.50; Horizontal scrolling doesn't work when compiled with pgtk Date: Wed, 22 Dec 2021 11:14:51 +0300 Message-ID: References: <878rwezqzk.fsf@yahoo.com> <20211221.222847.806642445048126400.masm@luna.pink.masm11.me> <8735mlv4h2.fsf@yahoo.com> <87r1a5tphk.fsf@yahoo.com> <87v8zhqidm.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17945"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuuki Harano , 52685@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 22 09:16:26 2021 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 1mzwnR-0004WR-J6 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Dec 2021 09:16:25 +0100 Original-Received: from localhost ([::1]:33674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzwnQ-0005Yc-6W for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Dec 2021 03:16:24 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzwn4-0005YG-5v for bug-gnu-emacs@gnu.org; Wed, 22 Dec 2021 03:16:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45061) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzwn3-0005uv-SP for bug-gnu-emacs@gnu.org; Wed, 22 Dec 2021 03:16:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mzwn3-0003vt-OU for bug-gnu-emacs@gnu.org; Wed, 22 Dec 2021 03:16:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrey Listopadov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Dec 2021 08:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52685 X-GNU-PR-Package: emacs Original-Received: via spool by 52685-submit@debbugs.gnu.org id=B52685.164016093715062 (code B ref 52685); Wed, 22 Dec 2021 08:16:01 +0000 Original-Received: (at 52685) by debbugs.gnu.org; 22 Dec 2021 08:15:37 +0000 Original-Received: from localhost ([127.0.0.1]:56597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzwmf-0003up-5N for submit@debbugs.gnu.org; Wed, 22 Dec 2021 03:15:37 -0500 Original-Received: from mail-ed1-f49.google.com ([209.85.208.49]:44590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzwmc-0003ud-CL for 52685@debbugs.gnu.org; Wed, 22 Dec 2021 03:15:34 -0500 Original-Received: by mail-ed1-f49.google.com with SMTP id w16so5358678edc.11 for <52685@debbugs.gnu.org>; Wed, 22 Dec 2021 00:15:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Igo9z4FC8go5T0iA72djoYBmdx8OSvDb7kYPR4NXpNk=; b=dMMRvccOVkol9p+ibkBVkgEG182MjD06gos1X5Gh7RZJbOKz2OLG8IUrFW+e39DAlU ptl90ZIQO/KDMy56NngNlNtzw9n3fq3zN+5bM1A8TvO8anfgO7H8/Nofk49BksHlEp2I eC+ENEDBnxYvf+d3s64faBw2cp2j3BNUwVh1Bm3mz7n/CywnorG3fJF0lhIBl3HHKrcU 5C6pVvux48JYV5ZmAcgYeiHcKfG+fU5+p1YNQvA9avv+z/52OAbOmo4UO4sSOtwVJGcA 8NX6rXIupKYS7TEECTOe+j88M7gNHwLWOZ0A4hEYVMwP1SQe2UZonLqXzTVZUAgGPIuI mfTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Igo9z4FC8go5T0iA72djoYBmdx8OSvDb7kYPR4NXpNk=; b=Uqq8fnAs8oilfxI5MrTE3vOkjxuh3QuyFRU+pP79zLwVy+AKLyaXImuMfMVHOtLlot c3z7Sx7viL+fPhm2nEtOyauxslBHaUiKMYnv3WWdgrA2EhIPRoEvtRz089xpNHJ/NRYR EKuAfMhMHQjIf8azfCZim748cJiJoPLXXmICK39kCk9WVAJa/Gu2A32J0dgGjyzwOnO5 Pv5gcG6S2e7wHxQgDl2+KUdA9NYjIFp6Sa4HdVIgFLiHv7cNKUuIowhxYX+4XV1nRz7L po34JikoSMAuuuEhS7vIjKQ9QUoVxqVnZa+1rHM20oh/3o5gQrD/GBVbF7X7aHqy+QTG xcag== X-Gm-Message-State: AOAM531VATQudk1749m0t7hSUamxpVNDN5NPg+hUWR3rqgkmBsfqbQVa vflSqXgM1henBU2hfvVI9x1PvHa7HLxNB6MUiwg= X-Google-Smtp-Source: ABdhPJydVV4k04IiV33oPW3p+escordT/gXV9gnxwnD8ri2fvjalGk4akQVfjjv42sM3wovjE5frZWsiWKbK2lCoiSI= X-Received: by 2002:a17:906:eb56:: with SMTP id mc22mr1565979ejb.331.1640160928539; Wed, 22 Dec 2021 00:15:28 -0800 (PST) In-Reply-To: <87v8zhqidm.fsf@yahoo.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" Xref: news.gmane.io gmane.emacs.bugs:222917 Archived-At: On Wed, Dec 22, 2021 at 9:11 AM Po Lu wrote: > > Andrey Listopadov writes: > > > On Wed, Dec 22, 2021 at 4:09 AM Po Lu wrote: > >> > >> Po Lu writes: > >> > >> > Andrey Listopadov writes: > >> > > >> >> When `pixel-scroll-precision-mode' is disabled everything works fine. > >> >> When compiled without `--with-pgtk' but with `--with-xinput2' > >> >> `pixel-scroll-precision-mode' works as expected. > >> > > >> > Thanks, I will look into this now. > >> > >> Please try the following patch to see if it resolves your problem. > >> Thanks. > >> > >> diff --git a/src/pgtkterm.c b/src/pgtkterm.c > >> index bd61c65edd..bea2650584 100644 > >> --- a/src/pgtkterm.c > >> +++ b/src/pgtkterm.c > >> @@ -6133,78 +6133,64 @@ scroll_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data) > >> } > >> else if (gdk_event_get_scroll_deltas (event, &delta_x, &delta_y)) > >> { > >> - dpyinfo->scroll.acc_x += delta_x; > >> - dpyinfo->scroll.acc_y += delta_y; > >> - if (dpyinfo->scroll.acc_y >= dpyinfo->scroll.y_per_line > >> - || !mwheel_coalesce_scroll_events) > >> + if (!mwheel_coalesce_scroll_events) > >> { > >> - int nlines = dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line; > >> - inev.ie.kind = WHEEL_EVENT; > >> - inev.ie.modifiers |= down_modifier; > >> - inev.ie.arg = list3 (make_fixnum (nlines), > >> - make_float (-dpyinfo->scroll.acc_x * 100), > >> - make_float (-dpyinfo->scroll.acc_y * 100)); > >> - if (!mwheel_coalesce_scroll_events) > >> - { > >> - dpyinfo->scroll.acc_y = 0; > >> - dpyinfo->scroll.acc_x = 0; > >> - } > >> - else > >> + inev.ie.kind = ((fabs (delta_x) > fabs (delta_y)) > >> + ? HORIZ_WHEEL_EVENT > >> + : WHEEL_EVENT); > >> + inev.ie.modifiers = (inev.ie.kind == HORIZ_WHEEL_EVENT > >> + ? (delta_x >= 0 ? down_modifier : up_modifier) > >> + : (delta_y >= 0 ? down_modifier : up_modifier)); > >> + inev.ie.arg = list3 (Qnil, make_float (delta_x), > >> + make_float (delta_y)); > >> + } > >> + else > >> + { > >> + dpyinfo->scroll.acc_x += delta_x; > >> + dpyinfo->scroll.acc_y += delta_y; > >> + if (dpyinfo->scroll.acc_y >= dpyinfo->scroll.y_per_line) > >> { > >> + int nlines = dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line; > >> + inev.ie.kind = WHEEL_EVENT; > >> + inev.ie.modifiers |= down_modifier; > >> + inev.ie.arg = list3 (make_fixnum (nlines), > >> + make_float (-dpyinfo->scroll.acc_x * 100), > >> + make_float (-dpyinfo->scroll.acc_y * 100)); > >> dpyinfo->scroll.acc_y -= dpyinfo->scroll.y_per_line * nlines; > >> } > >> - } > >> - else if (dpyinfo->scroll.acc_y <= -dpyinfo->scroll.y_per_line > >> - || !mwheel_coalesce_scroll_events) > >> - { > >> - int nlines = -dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line; > >> - inev.ie.kind = WHEEL_EVENT; > >> - inev.ie.modifiers |= up_modifier; > >> - inev.ie.arg = list3 (make_fixnum (nlines), > >> - make_float (-dpyinfo->scroll.acc_x * 100), > >> - make_float (-dpyinfo->scroll.acc_y * 100)); > >> - > >> - if (!mwheel_coalesce_scroll_events) > >> + else if (dpyinfo->scroll.acc_y <= -dpyinfo->scroll.y_per_line) > >> { > >> - dpyinfo->scroll.acc_y = 0; > >> - dpyinfo->scroll.acc_x = 0; > >> + int nlines = -dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line; > >> + inev.ie.kind = WHEEL_EVENT; > >> + inev.ie.modifiers |= up_modifier; > >> + inev.ie.arg = list3 (make_fixnum (nlines), > >> + make_float (-dpyinfo->scroll.acc_x * 100), > >> + make_float (-dpyinfo->scroll.acc_y * 100)); > >> + > >> + dpyinfo->scroll.acc_y -= -dpyinfo->scroll.y_per_line * nlines; > >> } > >> - else > >> - dpyinfo->scroll.acc_y -= -dpyinfo->scroll.y_per_line * nlines; > >> - } > >> - else if (dpyinfo->scroll.acc_x >= dpyinfo->scroll.x_per_char > >> - || !mwheel_coalesce_scroll_events) > >> - { > >> - int nchars = dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char; > >> - inev.ie.kind = HORIZ_WHEEL_EVENT; > >> - inev.ie.modifiers |= up_modifier; > >> - inev.ie.arg = list3 (make_fixnum (nchars), > >> - make_float (-dpyinfo->scroll.acc_x * 100), > >> - make_float (-dpyinfo->scroll.acc_y * 100)); > >> - > >> - if (mwheel_coalesce_scroll_events) > >> - dpyinfo->scroll.acc_x -= dpyinfo->scroll.x_per_char * nchars; > >> - else > >> + else if (dpyinfo->scroll.acc_x >= dpyinfo->scroll.x_per_char > >> + || !mwheel_coalesce_scroll_events) > >> { > >> - dpyinfo->scroll.acc_x = 0; > >> - dpyinfo->scroll.acc_y = 0; > >> + int nchars = dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char; > >> + inev.ie.kind = HORIZ_WHEEL_EVENT; > >> + inev.ie.modifiers |= up_modifier; > >> + inev.ie.arg = list3 (make_fixnum (nchars), > >> + make_float (-dpyinfo->scroll.acc_x * 100), > >> + make_float (-dpyinfo->scroll.acc_y * 100)); > >> + > >> + dpyinfo->scroll.acc_x -= dpyinfo->scroll.x_per_char * nchars; > >> } > >> - } > >> - else if (dpyinfo->scroll.acc_x <= -dpyinfo->scroll.x_per_char) > >> - { > >> - int nchars = -dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char; > >> - inev.ie.kind = HORIZ_WHEEL_EVENT; > >> - inev.ie.modifiers |= down_modifier; > >> - inev.ie.arg = list3 (make_fixnum (nchars), > >> - make_float (-dpyinfo->scroll.acc_x * 100), > >> - make_float (-dpyinfo->scroll.acc_y * 100)); > >> - > >> - if (mwheel_coalesce_scroll_events) > >> - dpyinfo->scroll.acc_x -= -dpyinfo->scroll.x_per_char * nchars; > >> - else > >> + else if (dpyinfo->scroll.acc_x <= -dpyinfo->scroll.x_per_char) > >> { > >> - dpyinfo->scroll.acc_x = 0; > >> - dpyinfo->scroll.acc_y = 0; > >> + int nchars = -dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char; > >> + inev.ie.kind = HORIZ_WHEEL_EVENT; > >> + inev.ie.modifiers |= down_modifier; > >> + inev.ie.arg = list3 (make_fixnum (nchars), > >> + make_float (-dpyinfo->scroll.acc_x * 100), > >> + make_float (-dpyinfo->scroll.acc_y * 100)); > >> + > >> + dpyinfo->scroll.acc_x -= -dpyinfo->scroll.x_per_char * nchars; > >> } > >> } > >> } > > > The patch doesn't apply. > > That's odd. Could you try updating your checkout, or failing that, > applying it manually? > > Thanks. > Sorry, seems the mail got corrupted the first time I tried. I've applied the patch, and now horizontal scrolling works correctly. However, pressing Ctrl while scrolling doesn't register as `C-' event. With `pixel-scroll-precision-mode` off, if I press C-h k and scroll in any direction with the Ctrl key held down I get this: There were several key-sequences: C- at that spot runs the command mouse-wheel-text-scale C- at that spot runs the command mouse-wheel-text-scale (Since C- and C- aren't mapped to anything they're not in the list) With `pixel-scroll-precision-mode` on I get: There were several key-sequences: at that spot runs the command pixel-scroll-precision at that spot runs the command pixel-scroll-precision at that spot runs the command mwheel-scroll at that spot runs the command mwheel-scroll runs the command pixel-scroll-start-momentum So the scrolling works, but the Ctrl key is ignored now. The same happens with other modifier keys. -- Andrey Listopadov