From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#51794: 29.0.50; invalid input events generated from a mouse click for the tab bar Date: Sat, 20 Nov 2021 10:56:13 +0100 Message-ID: <87028c49-bee3-4246-c812-f385124be815@gmx.at> References: <83tuggy14y.fsf@gnu.org> <83h7cgxjbm.fsf@gnu.org> <83fss0xgn9.fsf@gnu.org> <835yswxedz.fsf@gnu.org> <83pmqwwrwj.fsf@gnu.org> <83h7c7tft5.fsf@gnu.org> <6ceafce2-eee9-5d93-6300-1f1b430b3f65@gmx.at> <838rxjtctn.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------494034832B2E95933AFC1C74" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39007"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51794@debbugs.gnu.org, mark.t.kennedy@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 20 10:57:11 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 1moN7P-0009yn-45 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Nov 2021 10:57:11 +0100 Original-Received: from localhost ([::1]:41686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1moN7O-0002Ka-1D for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Nov 2021 04:57:10 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moN7G-0002JM-PW for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 04:57:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58441) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moN7G-0002t9-HT for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 04:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1moN7G-0003E8-Gs for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 04:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Nov 2021 09:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51794 X-GNU-PR-Package: emacs Original-Received: via spool by 51794-submit@debbugs.gnu.org id=B51794.163740219012332 (code B ref 51794); Sat, 20 Nov 2021 09:57:02 +0000 Original-Received: (at 51794) by debbugs.gnu.org; 20 Nov 2021 09:56:30 +0000 Original-Received: from localhost ([127.0.0.1]:41749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moN6k-0003Cq-Do for submit@debbugs.gnu.org; Sat, 20 Nov 2021 04:56:30 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:49631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moN6b-0003CT-SJ for 51794@debbugs.gnu.org; Sat, 20 Nov 2021 04:56:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1637402174; bh=2g3t79eSRncuzg6p2mgfrNJvGZ4FwKXJnqd30ePOsi8=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=TdebA6IA8g6aVMWlerepqmcbQfLgCxWqYcWsvySjR0uVZeDUOEAm9AtiksarHcp8e rPjZNlCxsGJrVXTJpQm2BVJ5bDf7R/CIRLq5zK+V6N1Duk5qxPoownkSUeApmMUu+8 4LuvE89/j8wTkuHfrWpqhMEJ9pNaqoLwd41iC8nM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.101] ([212.95.5.37]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MWzjt-1n8RD51AUL-00XH1s; Sat, 20 Nov 2021 10:56:14 +0100 In-Reply-To: <838rxjtctn.fsf@gnu.org> Content-Language: en-US X-Provags-ID: V03:K1:yEkmZA+UFvif+zvNvJynSJwm6tGfiR6mueBPN7QfBgwzBGaMGk7 b5gNPuqmCb72NLNlrzZ6I5JF0NJc6AvzwV1g6LJKd6sJ3zNa3qGp75UF4SxNTvs27tM7sGa HvFembnWZh7ntcb833Eh3lSfaNROZ8sBak53oGsHv6F+UT6kwSFtwvRGdDfDlCnXhDzabVU DiAaZPpk4r2VKAYbalrTA== X-UI-Out-Filterresults: notjunk:1;V03:K0:yq30xI5ulu8=:tt2aZVlk2NkfIjOBKyk55R n63e9T6ykKVtIzCRNM+3LKyiUJj9H86VZ9KyGIGoCeMvaf1AbCTZOWn45To8jVQFo9TgBsgXw YAfEwEnqH/o6FE1VX3pUJvokIBT7u8A33fScKpKFKfUFif5G9bR4gO2NGni/nvdr8+hq11Y9e eewq7tjTfI29Fhh5crfIqg9WL3bveEaXa4ctN+7fIYX9Gparf1+pFUf3RG6dMXYsmlGHEAmGN 5t+lBPo1ZaURhKYF6Xsxzd7Lqd2yxPWnoMR4/O08EdfD76wZDX8iXY8auUHi4GAxAMnLh38ys EUarrsYVrkV01DkdMPpS0Oua14IF9nLXhIN9VWR6VRfUlPb529fw7OR0+7X9RWLgc6dson6NL VcluwvfcnTEjzNjfwwbZmCu67GNqBd+bScaSdgIF3XzjVPSAptwo3dS4X9mWWnt9i4+vkZw3/ sP1qE2vSF/Jey59Rz9x9LNI0+wu9+2paX/TF8AHx34PZKYlIepdY9ZhgZ7MK/LySK1Izdbu2/ vinzkQAuNcAhWHPT6n2UDy6KDgNSyYTsMMptKUOP6hcbr1CEBCOjQXy1yOMlvj8yEE92qDLAW gZ0wk5N4NlWmkGLYBYrZHKa7QyCA1mYbZkGee65smOyINxWFNBc8u58lRg0oFU/8ABZsQrpY/ J5Jw3rVR8zdayOCd9EA6+ermRiqgV/0AQSQ5mQjlA7GVVefxTFuk2ycwlD0+EOZzNjmAD2EqL xUVpf6C3kq/fO7v8WN/Vx+KM+jxRzAQ/FZLjxrlDYLoRU/L73xe4Df+Mcwwd7dX3COVsxbuw 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:220484 Archived-At: This is a multi-part message in MIME format. --------------494034832B2E95933AFC1C74 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit > If you have problems, please post the patch and I will install it. Attached. ChangeLog would go as: Report mouse events on tab or tool bar when 'track-mouse' is t (Bug#51794) * lisp/mouse.el (mouse-drag-track) * lisp/mouse-drag.el (mouse-drag-drag): Set 'track-mouse' to some value neither t nor nil (Bug#51794). * src/keyboard.c (make_lispy_position): If track_mouse is Qt, report event on tool or tab bar (Bug#51794). Please fix everything as you see fit. Thanks, martin --------------494034832B2E95933AFC1C74 Content-Type: text/x-patch; name="track-mouse.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="track-mouse.diff" diff --git a/lisp/mouse-drag.el b/lisp/mouse-drag.el index ecfb359b36..0cdba6b4d0 100644 =2D-- a/lisp/mouse-drag.el +++ b/lisp/mouse-drag.el @@ -282,6 +282,8 @@ mouse-drag-drag (setq window-last-row (- (window-height) 2) window-last-col (- (window-width) 2)) (track-mouse + ;; Set 'track-mouse' to something neither nil nor t (Bug#51794). + (setq track-mouse 'drag-dragging) (while (progn (setq event (read--potential-mouse-event) end (event-end event) diff --git a/lisp/mouse.el b/lisp/mouse.el index 7bac6dd07b..8497c50363 100644 =2D-- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -1615,7 +1615,8 @@ mouse-drag-track (goto-char (nth 1 range))) (setf (terminal-parameter nil 'mouse-drag-start) start-event) - (setq track-mouse t) + ;; Set 'track-mouse' to something neither nil nor t (Bug#51794). + (setq track-mouse 'drag-tracking) (setq auto-hscroll-mode nil) (set-transient-map diff --git a/src/keyboard.c b/src/keyboard.c index a99d14cb4c..451863a28a 100644 =2D-- a/src/keyboard.c +++ b/src/keyboard.c @@ -5124,19 +5124,20 @@ make_lispy_position (struct frame *f, Lisp_Object = x, Lisp_Object y, #endif ) { - /* FIXME: While track_mouse is non-nil, we do not report this + /* While 'track-mouse' is neither nil nor t, do not report this event as something that happened on the tool or tab bar since - that would break mouse dragging operations that originate from - an ordinary window beneath and expect the window to auto-scroll - as soon as the mouse cursor appears above or beneath it - (Bug#50993). Since this "fix" might break track_mouse based - operations originating from the tool or tab bar itself, such - operations should set track_mouse to some special value that - would be recognized by the following check. - - This issue should be properly handled by 'mouse-drag-track' and - friends, so the below is only a temporary workaround. */ - if (NILP (track_mouse)) + that would break mouse drag operations that originate from an + ordinary window beneath that bar and expect the window to + auto-scroll as soon as the mouse cursor appears above or + beneath it (Bug#50993). We do allow reports for t, because + applications may have set 'track-mouse' to t and still expect a + click on the tool or tab bar to get through (Bug#51794). + + FIXME: This is a preliminary fix for the bugs cited above and + awaits a solution that includes a convention for all special + values of 'track-mouse' and their documentation in the Elisp + manual. */ + if (NILP (track_mouse) || EQ (track_mouse, Qt)) posn =3D EQ (window_or_frame, f->tab_bar_window) ? Qtab_bar : Qtool_bar; /* Kludge alert: for mouse events on the tab bar and tool bar, keyboard.c wants the frame, not the special-purpose window --------------494034832B2E95933AFC1C74--