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#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:59:36 +0800 Message-ID: <87lf2oazyv.fsf@yahoo.com> References: <87h7dcecex.fsf.ref@yahoo.com> <87h7dcecex.fsf@yahoo.com> <87lf2o41y1.fsf@mail.linkov.net> <87v91sb0ve.fsf@yahoo.com> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29125"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51298@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 20 10:03:20 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 1md6ZC-0007KR-V5 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Oct 2021 10:03:19 +0200 Original-Received: from localhost ([::1]:60226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1md6ZB-0005wE-Pw for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Oct 2021 04:03:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1md6W4-0003GS-1P for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2021 04:00:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41027) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1md6W3-0006ND-Nb for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2021 04:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1md6W3-0004Xn-Ha for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2021 04:00:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Oct 2021 08:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51298 X-GNU-PR-Package: emacs Original-Received: via spool by 51298-submit@debbugs.gnu.org id=B51298.163471679517418 (code B ref 51298); Wed, 20 Oct 2021 08:00:03 +0000 Original-Received: (at 51298) by debbugs.gnu.org; 20 Oct 2021 07:59:55 +0000 Original-Received: from localhost ([127.0.0.1]:52573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1md6Vv-0004Wr-KZ for submit@debbugs.gnu.org; Wed, 20 Oct 2021 03:59:55 -0400 Original-Received: from sonic305-20.consmr.mail.ne1.yahoo.com ([66.163.185.146]:36131) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1md6Vt-0004Wc-2J for 51298@debbugs.gnu.org; Wed, 20 Oct 2021 03:59:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634716786; bh=4AjuXBbsBLFZXTpEsBqVt5aOzRSopIEfDWZTFqr1feA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=kw4i4odx2Wl40a+MaqYRrj4sD/9Gidiyelv9guO1nRK/AyI5wUWh2vWK/ybok2/JlnT7tfdJiLmbbkXoEBEvMnekXwrDemtvOyoU4QsTGsQX75u8R0txZJcleZcQL2AWl6bYDL7ZZ24fdVbjqxPaKlyJmjv2t6B6XFTzj+Y+QBbsw5jctA8otQcwrPiJJP/i917eDkMJnjVxBzleEeGDOGIHKqUiRFH188GGmdixUBuyyL8YEq1DrmtevchNc6Qc8WqQJghawDZGEUxtTXsJPJ5pIv4a8nvO/ZE2JxwoytK+z87Bd8dMfY9cfxHibtYCR1PCFaDZRQXHrwD6AGnFIg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634716786; bh=qsbJAdxiNHT4Msmni+UuWlHH/syMh++qBxpQVuTkcE5=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=DVxpQcqVv50QKiDflX+KKPB0I6javtUg8b5GFoO8rFpIsoRxNCzAoA4uMviRdzbLXO128ssAiUyMqUcrfTYDoJfoXpGFi2GMXBFOdr4ESgW9kXkAocE999cL3qnu8rOG3N9lz92FgpwerLRqOJAPIAzteDvz2rgS39Xkf8mlQpkNU0Qp57D1sIpXKp+RUm0ZDmlI3yol3X0wME/nBcD/50mIgXwTIHX318XaAjpPki/WL7Mbub4L+MAkKTKlqbbyJ2hZF775QGwqYL4FZluOnlhT5kos3sdM04xR1RcaueODoRC5KwLns9kLx+7yU52hG4o/UMf+htKNmPJVNu9+SQ== X-YMail-OSG: coCsGbsVM1n0Xf0stqjt_bupiEihmTTlzpJhO_63h4DFcFYQcDITxWxVUTXX182 ZwQqsXQMK_C8Wj02z4qMqbfxlgUaBHPJhlphTCWjMwsW3ZTrsBmZMkjn3K4Ipi6PfXg0mk2szB0T opROa2z1Hsrs5xSvVKxbdmJlp75CPE9mpXisyWwle.ZDrDmykMzBnlaX6woOXcjTiAMr84XDHplE ygIGxGe4OYiEusnBWaW_TO7gL44WHnOY08aCVwV8AXQJyWxKhTuJpr3ll8m80h9wGcpTH1sbBueP p0EElU93Vq2vUd4duD9pGnHXZPYclgrelFlgZGfkPrOvR63Ok9VtrAbWA8OHu_a4Dusx8JowUTGI PN2usSf6RPBjkjuq_tyuZO0cjS56h0evvbC4t2REMDmdVbtIaq59ZJWY7DTheLVlE5DEB7KIlwoK srO_SNFBu0U52FWYCBon1o1oSnGrwbXmnV36kZBV9X.dX6fv1o42hX_cK3brC0VU2KYDhU4mg9Yn OC1di5mFw3JlW83o2pqYPJdC6ERy.pxj6FtNW7Ll2N5.pTpl6kVN9H_sza0f7jgxKIZVOCqnKht6 K7hfiRTNRzqlWRDe.l9v7uqsgo8f0.tbm4yNoXLXFlMZTkKHTLsOk3491_IbdZ0zidRFZjrOdf4j NhAipUZjVsTr5ELtFzMNZTBB8GKO858Q5djt42Nr.dxoItvSlxz8SGvNLrK_6Kq9RT9xtQEc7gZy OH1edRAVOeagjcXWqORNa3IfUew1XnAjNCG1C21qbZCu8fSjsOFKwChYDG968tMo_1qVdD6vWTVj 2Nb7TmtCroECMxTMTG5uOGh5DZwkeNNYvCUmCNuJ7y X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Wed, 20 Oct 2021 07:59:46 +0000 Original-Received: by kubenode512.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 3bdfd3e8725123dcb073c547bb156e91; Wed, 20 Oct 2021 07:59:39 +0000 (UTC) In-Reply-To: <87v91sb0ve.fsf@yahoo.com> (Po Lu's message of "Wed, 20 Oct 2021 15:40:05 +0800") X-Mailer: WebService/1.1.19116 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:217635 Archived-At: --=-=-= Content-Type: text/plain BTW, I'm attaching another patch that makes the tab bar behave closer to other programs. I've explained the behaviour in the commit message. WDYT? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Display-a-tab-bar-item-as-sunken-when-appropriate.patch >From 69b4f84bdcd76bccee1e2af5b334b03ace918f9f Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 20 Oct 2021 15:55:10 +0800 Subject: [PATCH] Display a tab bar item as sunken when appropriate When the mouse pointer is pressed on the tab bar, moved out of the tab bar, and moved back in, it would be more appropriate to behave like other programs by displaying the item as sunken. * src/xdisp.c (note_tab_bar_highlight): Display item as sunken if the mouse pointer returns to the tab bar down. --- src/xdisp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index c6b8ca636e..72b359789d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13866,12 +13866,17 @@ note_tab_bar_highlight (struct frame *f, int x, int y) clear_mouse_face (hlinfo); bool mouse_down_p = false; - /* Mouse is down, but on different tab-bar item? */ + /* Mouse is down, but on different tab-bar item? Or alternatively, + the mouse might've been pressed somewhere we don't know about, + and then have moved onto the tab bar. In this case, + last_tab_bar_item is -1, so we DTRT and behave like other + programs by displaying the item as sunken. */ Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f); mouse_down_p = (gui_mouse_grabbed (dpyinfo) && f == dpyinfo->last_mouse_frame); - if (mouse_down_p && f->last_tab_bar_item != prop_idx) + if (mouse_down_p && f->last_tab_bar_item != prop_idx + && f->last_tab_bar_item != -1) return; draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED; -- 2.31.1 --=-=-=--