From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 01 08:30:33 2020 Received: (at submit) by debbugs.gnu.org; 1 Jul 2020 12:30:34 +0000 Received: from localhost ([127.0.0.1]:52488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jqbsn-000053-F0 for submit@debbugs.gnu.org; Wed, 01 Jul 2020 08:30:33 -0400 Received: from lists.gnu.org ([209.51.188.17]:57910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jqbsg-0008WV-Kg for submit@debbugs.gnu.org; Wed, 01 Jul 2020 08:30:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqbsg-0007Ui-2d for bug-gnu-emacs@gnu.org; Wed, 01 Jul 2020 08:30:26 -0400 Received: from erc.thregr.org ([2001:41c9:1:41f::63]:60462) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqbse-0000OX-32 for bug-gnu-emacs@gnu.org; Wed, 01 Jul 2020 08:30:25 -0400 Received: from [193.106.183.2] (helo=localhost) by erc.thregr.org with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1jqbsf-001x2w-QS (envelope-from ) for bug-gnu-emacs@gnu.org; Wed, 01 Jul 2020 14:30:26 +0200 User-agent: mu4e 1.5.4; emacs 28.0.50 From: Yuri D'Elia To: bug-gnu-emacs@gnu.org Subject: 28.0.50; Bad mouse interaction in the scroll-margin region Date: Wed, 01 Jul 2020 14:30:14 +0200 Message-ID: <87d05fs9ih.fsf@wavexx.thregr.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:41c9:1:41f::63; envelope-from=wavexx@thregr.org; helo=erc.thregr.org X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) The combined behavior of the mouse and "scroll-margin" is a bit odd currently. If you have a buffer which has "scroll-margin" enabled, and you click anywhere in the scroll-margin region, the point is moved and the buffer is immediately scrolled. This in turn often results in the click becoming a "drag" instead, selecting parts of the buffer. I rarely use the mouse, but when I do (usually in customize groups, or when using eww), it trips me all the time since I use a rather large scroll-margin. If feels like that moving the point when using the mouse shouldn't trigger scroll-margin ever, since any action that causes a scroll would immediately move the current target away and result in unintended behavior. I can see the same effect when performing a selection by dragging: once you reach the scroll-margin area every single motion events selects half the visible buffer, which is also broken. In GNU Emacs 28.0.50 (build 36, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw scroll bars) of 2020-06-30 built on eab18045nb Repository revision: bc8089a3fa11161428c51439fd3b26fd6583345d Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: Debian GNU/Linux bullseye/sid Configured using: 'configure --with-x-toolkit=lucid --with-modules --without-gsettings --with-cairo CC=gcc 'CFLAGS=-O3 -march=native -pipe ' LDFLAGS=-fwhole-program' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ LIBOTF ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 01 10:13:40 2020 Received: (at 42150) by debbugs.gnu.org; 1 Jul 2020 14:13:40 +0000 Received: from localhost ([127.0.0.1]:53521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jqdUZ-0002ya-UD for submit@debbugs.gnu.org; Wed, 01 Jul 2020 10:13:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jqdUY-0002yN-0X for 42150@debbugs.gnu.org; Wed, 01 Jul 2020 10:13:38 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39623) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqdUS-0000AQ-5o; Wed, 01 Jul 2020 10:13:32 -0400 Received: from [176.228.60.248] (port=4718 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jqdUQ-0006Y3-4q; Wed, 01 Jul 2020 10:13:31 -0400 Date: Wed, 01 Jul 2020 17:13:23 +0300 Message-Id: <83366bz5ks.fsf@gnu.org> From: Eli Zaretskii To: Yuri D'Elia In-Reply-To: <87d05fs9ih.fsf@wavexx.thregr.org> (message from Yuri D'Elia on Wed, 01 Jul 2020 14:30:14 +0200) Subject: Re: bug#42150: 28.0.50; Bad mouse interaction in the scroll-margin region References: <87d05fs9ih.fsf@wavexx.thregr.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 42150 Cc: 42150@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Yuri D'Elia > Date: Wed, 01 Jul 2020 14:30:14 +0200 > > The combined behavior of the mouse and "scroll-margin" is a bit odd > currently. As discussed elsewhere, the problem here is to define alternative behavior that could make sense while preventing the downsides. > If you have a buffer which has "scroll-margin" enabled, and you click > anywhere in the scroll-margin region, the point is moved and the buffer > is immediately scrolled. That is true, but it's the intended behavior: a mouse clock sets point, and the scroll-margin says scroll the window when point enters the margin for any reason. So this does what it should do. > This in turn often results in the click becoming a "drag" instead, > selecting parts of the buffer. This part I couldn't reproduce. Maybe it's specific to the window-system you are using or to something else that isn't Emacs per se. > If feels like that moving the point when using the mouse shouldn't > trigger scroll-margin ever, since any action that causes a scroll would > immediately move the current target away and result in unintended > behavior. I don't think I understand what you mean by "move the current target away". Text scrolls, but it doesn't scroll out of the window, at least not in my testing. > I can see the same effect when performing a selection by > dragging: once you reach the scroll-margin area every single motion > events selects half the visible buffer, which is also broken. You need to select "carefully", and then it doesn't select half of the window, but only what you dragged across. But yes, this is a bit tricky. Once again, the problem is to decide what to do instead. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 02 18:03:23 2020 Received: (at 42150) by debbugs.gnu.org; 2 Sep 2020 22:03:23 +0000 Received: from localhost ([127.0.0.1]:60970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDaqh-000773-M8 for submit@debbugs.gnu.org; Wed, 02 Sep 2020 18:03:23 -0400 Received: from mail-ej1-f42.google.com ([209.85.218.42]:41719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDaqf-00076p-Cz for 42150@debbugs.gnu.org; Wed, 02 Sep 2020 18:03:22 -0400 Received: by mail-ej1-f42.google.com with SMTP id lo4so836514ejb.8 for <42150@debbugs.gnu.org>; Wed, 02 Sep 2020 15:03:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=/sxQFgEBwrnJgVJzDVT8/yYtF8W1QcAeJK0LrgxCUoE=; b=qLROo3LM74L0dBfP7tY5660XhKX4mLrFdw6OHWIOpucv6IHY7/odXX4qYZRmcwZfVK nrnNz8YB4xxzqI0oabDunH+/hZFT2HUSZv7cflGRIa5O+wIZa2Na/QJ9Umt1aCgUEZf3 MaDe8rE74jCbzjpb9mL/do+WfyJVDVpMQ+leuKkgKPms2IgcIA5aIzI72S6afyRASEzd 76dIiKMk30mmvA7M/bVorZf2L76B3ZGoH6VQXM3izozGjTZDxU7t/fAsAjmy4P8VJ59a nf3ZOU+nIEkBA+OjJdmB+q8vZ5KzAEH3vI8W6ruMIf0mmWMJC/G0yU1i/eE6lXkm4avU knWw== X-Gm-Message-State: AOAM532YqHCcF6DU9b2LLaBappL+4Awjnpqxw4zabDxvmnwJ9ZDj9b1X EE5AJCoGRkb0Krob/gBmojAw9eDbEk76mql/K8I= X-Google-Smtp-Source: ABdhPJxOi4Gk9CFs4Yyor6zFF8IGbqdhXvVaHiw2/XBo/Jyo94IzNVRyhH/IafnMNf27TJ3Ye+pAfZgdkd1AwCSnL+g= X-Received: by 2002:a17:906:2b57:: with SMTP id b23mr247362ejg.26.1599084195635; Wed, 02 Sep 2020 15:03:15 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 2 Sep 2020 18:03:15 -0400 From: Stefan Kangas In-Reply-To: <83366bz5ks.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 01 Jul 2020 17:13:23 +0300") References: <87d05fs9ih.fsf@wavexx.thregr.org> <83366bz5ks.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Date: Wed, 2 Sep 2020 18:03:15 -0400 Message-ID: Subject: Re: bug#42150: 28.0.50; Bad mouse interaction in the scroll-margin region To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 42150 Cc: Yuri D'Elia , 42150@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: >> This in turn often results in the click becoming a "drag" instead, >> selecting parts of the buffer. > > This part I couldn't reproduce. Maybe it's specific to the > window-system you are using or to something else that isn't Emacs per > se. I can reproduce this if I click mouse-1, hold the mouse button down and then move the mouse cursor. Tried on: In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars) of 2020-08-17 built on joffe In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.16.0) of 2020-09-02 built on joffe From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 31 09:54:39 2021 Received: (at 42150) by debbugs.gnu.org; 31 Oct 2021 13:54:39 +0000 Received: from localhost ([127.0.0.1]:59283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhBIF-0000qc-0y for submit@debbugs.gnu.org; Sun, 31 Oct 2021 09:54:39 -0400 Received: from erc.thregr.org ([46.43.2.63]:52212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhBID-0000qU-IU for 42150@debbugs.gnu.org; Sun, 31 Oct 2021 09:54:37 -0400 Received: from [193.106.183.18] (helo=localhost) by erc.thregr.org with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1mhBIF-001FQg-Ch (envelope-from ); Sun, 31 Oct 2021 14:54:39 +0100 References: <87d05fs9ih.fsf@wavexx.thregr.org> <83366bz5ks.fsf@gnu.org> User-agent: mu4e 1.7.4; emacs 29.0.50 From: Yuri D'Elia To: Stefan Kangas Subject: Re: bug#42150: 28.0.50; Bad mouse interaction in the scroll-margin region Date: Sun, 31 Oct 2021 14:47:40 +0100 In-reply-to: Message-ID: <87zgqppaew.fsf@wavexx.thregr.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 42150 Cc: Eli Zaretskii , 42150@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Wed, Sep 02 2020, Stefan Kangas wrote: > I can reproduce this if I click mouse-1, hold the mouse button down and > then move the mouse cursor. Tried on: > > In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo > version 1.16.0, Xaw3d scroll bars) > of 2020-08-17 built on joffe > > In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version > 3.24.22, cairo version 1.16.0) > of 2020-09-02 built on joffe For posterity, a partial fix for this behavior has been merged through my commit patch in e62d1fa9831cc4f046b330f438f8bd49a27a2458. There is still one scenario which IMHO deserves to be fixed before we can close this: double-clicking inside the scroll-margin area turns the double-click into a double-click+scroll (or triple+scroll). This happens because the click-count is handled at the term level, and doesn't see that the "logical" click coordinate has been shifted as a result of the scroll. The scrolling in this case should also reset the current click count.