From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Tab bar tabs landed on master Date: Wed, 09 Oct 2019 13:51:57 +0300 Message-ID: <83y2xuur76.fsf@gnu.org> References: <8736gci5jn.fsf@mail.linkov.net> <83muej8a0f.fsf@gnu.org> <87zhijqfys.fsf@mail.linkov.net> <834l0r84at.fsf@gnu.org> <87bluyj51u.fsf@mail.linkov.net> <838spz45zc.fsf@gnu.org> <87a7aex2v9.fsf@mail.linkov.net> <83k19h3it3.fsf@gnu.org> <87sgo4tlic.fsf@mail.linkov.net> <83blusz7ec.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="26439"; mail-complaints-to="usenet@blaine.gmane.org" Cc: lekktu@gmail.com, emacs-devel@gnu.org To: juri@linkov.net Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 09 19:19:20 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iIFcO-0006eu-5U for ged-emacs-devel@m.gmane.org; Wed, 09 Oct 2019 19:19:20 +0200 Original-Received: from localhost ([::1]:52956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIFcM-00089R-08 for ged-emacs-devel@m.gmane.org; Wed, 09 Oct 2019 13:19:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58827) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iI9Zp-0004UV-93 for emacs-devel@gnu.org; Wed, 09 Oct 2019 06:52:18 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38421) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iI9Zo-0008M6-Qz; Wed, 09 Oct 2019 06:52:16 -0400 Original-Received: from [176.228.60.248] (port=2859 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iI9Zo-0008G5-51; Wed, 09 Oct 2019 06:52:16 -0400 In-reply-to: <83blusz7ec.fsf@gnu.org> (message from Eli Zaretskii on Mon, 07 Oct 2019 22:23:55 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240768 Archived-At: > Date: Mon, 07 Oct 2019 22:23:55 +0300 > From: Eli Zaretskii > Cc: lekktu@gmail.com, emacs-devel@gnu.org > > > I prepared everything needed to test on a GPM-capable console, > > so now I'm ready to help you in testing your patch. > > Thanks, I will send a patch soon, probably tomorrow. (For some value of "tomorrow". Sorry for the delay.) The patch is below, I hope I didn't goof. Let me know if there are problems this causes. It is possible that we will need to force reset of up_modifier bit from the event modifiers inside tty_handle_tab_bar_click, I'm not sure. If you get error messages when clicking on the tab bar saying something like " is undefined", this is the reason. diff --git a/src/term.c b/src/term.c index 6420105..b60484e 100644 --- a/src/term.c +++ b/src/term.c @@ -2568,6 +2568,14 @@ handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event, else { f->mouse_moved = 0; term_mouse_click (&ie, event, f); + if (tty_handle_tab_bar_click (f, event->x, event->y, + (ie.modifiers & down_modifier) != 0, &ie)) + { + /* tty_handle_tab_bar_click stores 2 events in the event + queue, so we are done here. */ + count += 2; + return count; + } } done: