all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: 51298@debbugs.gnu.org
Subject: bug#51298: 29.0.50; Tab bar buttons won't highlight after the mouse is released outside the tab bar
Date: Wed, 20 Oct 2021 15:40:05 +0800	[thread overview]
Message-ID: <87v91sb0ve.fsf@yahoo.com> (raw)
In-Reply-To: <87lf2o41y1.fsf@mail.linkov.net> (Juri Linkov's message of "Wed,  20 Oct 2021 09:58:46 +0300")

[-- Attachment #1: Type: text/plain, Size: 199 bytes --]

Juri Linkov <juri@linkov.net> writes:

> Patches welcome.

Thanks, please test.  The issue was because f->last_tab_bar_item
wouldn't be cleared when the mouse click was dropped outside the tab
bar.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-tab-bar-item-highlight-when-a-mouse-click-is-dro.patch --]
[-- Type: text/x-patch, Size: 998 bytes --]

From 0b56777754cc5112c35c04d1da2a1154eed6e0bd Mon Sep 17 00:00:00 2001
From: Po Lu <luangruo@yahoo.com>
Date: Wed, 20 Oct 2021 15:36:59 +0800
Subject: [PATCH] Fix tab bar item highlight when a mouse click is dropped

* src/xdisp.c (note_mouse_highlight): Clear last_tab_bar_item if the
movement wasn't made on top of the tab bar.
---
 src/xdisp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/xdisp.c b/src/xdisp.c
index 1a65066ef9..888bf2d88d 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -33786,6 +33786,14 @@ note_mouse_highlight (struct frame *f, int x, int y)
       else
 	return;
     }
+  else
+    {
+      /* The mouse might have pressed into the tab bar, but might
+	 also have been released outside the tab bar, so
+	 f->last_tab_bar_item must be reset, in order to make sure the
+	 item can be still highlighted again in the future.  */
+      f->last_tab_bar_item = -1;
+    }
 #endif
 
 #if defined (HAVE_WINDOW_SYSTEM) && ! defined (HAVE_EXT_TOOL_BAR)
-- 
2.31.1


  reply	other threads:[~2021-10-20  7:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87h7dcecex.fsf.ref@yahoo.com>
2021-10-20  1:02 ` bug#51298: 29.0.50; Tab bar buttons won't highlight after the mouse is released outside the tab bar Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-20  6:58   ` Juri Linkov
2021-10-20  7:40     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-10-20  7:59       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-20 16:43         ` Juri Linkov
2022-04-22 15:59           ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v91sb0ve.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=51298@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.