From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Tab bar tabs landed on master Date: Sun, 12 Jan 2020 01:57:22 +0200 Organization: LINKOV.NET Message-ID: <87sgkllhyl.fsf@mail.linkov.net> 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> <83y2xuur76.fsf@gnu.org> <871rvliwtu.fsf@mail.linkov.net> <83v9sxu4mc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="208103"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.60 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jan 12 01:13:14 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.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 1iqQs1-000jav-Nj for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Jan 2020 01:12:46 +0100 Original-Received: from localhost ([::1]:33868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iqQs0-0006DW-0c for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Jan 2020 19:12:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52552) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iqQrT-0005nS-GA for emacs-devel@gnu.org; Sat, 11 Jan 2020 19:12:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iqQrR-0004AZ-VP for emacs-devel@gnu.org; Sat, 11 Jan 2020 19:12:11 -0500 Original-Received: from bisque.elm.relay.mailchannels.net ([23.83.212.18]:25944) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iqQrQ-0003wv-2j; Sat, 11 Jan 2020 19:12:08 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 5F033501696; Sun, 12 Jan 2020 00:12:05 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a77.g.dreamhost.com (100-96-168-177.trex.outbound.svc.cluster.local [100.96.168.177]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id DA0AF50107D; Sun, 12 Jan 2020 00:12:04 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a77.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Sun, 12 Jan 2020 00:12:05 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Invention-Lyrical: 5e5d64ac02272038_1578787925168_3363242754 X-MC-Loop-Signature: 1578787925168:2899095033 X-MC-Ingress-Time: 1578787925168 Original-Received: from pdx1-sub0-mail-a77.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a77.g.dreamhost.com (Postfix) with ESMTP id A389CB2060; Sat, 11 Jan 2020 16:12:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=v9ZPsWLTrTOYDMwr0UhcCQ0aVv8=; b= g7RFPRZFIVmhk8f11xIIeQZpdQr5uf4tsw4xwNSgoz7J8EPWoskCdr8aj7/mTqnm QIykSdg6Pg80o8K8qnaTsmYXCf9IR/uzisgY944I1v+qg3NV+S12qFnAgTM6ifU3 6z6scBLiYGqSN0J7BKjs1hbZaLvHiUEO/JQ/XEpeI0o= Original-Received: from mail.jurta.org (m91-129-103-172.cust.tele2.ee [91.129.103.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a77.g.dreamhost.com (Postfix) with ESMTPSA id DD7BCB205E; Sat, 11 Jan 2020 16:12:01 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a77 In-Reply-To: <83v9sxu4mc.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 09 Oct 2019 21:59:39 +0300") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrvdeiiedgvddtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdefrddujedvnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtfedrudejvddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegvlhhiiiesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 23.83.212.18 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:244207 Archived-At: >> > 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. >> >> Today I tried your patch, and observe the following behavior - >> typing on a tab displays in the each area: >> >> tab-bar up-current-tab- >> >> and waits for reading the next event. > > I think this is a sign that the up_modifier needs to be reset from the > event modifiers inside tty_handle_tab_bar_click, as I envisioned. Can > you try that? Finally I got a chance to test this on a GPM-capable console (there was a problem that the key on my keyboard is broken that is not a problem on X where it's remapped to , but on the console only the key has an alternative , not , and using such replacements as 'ESC x next-line RET' is too cumbersome, ISTR there was some support for key remapping, and I used it long ago on console, but already forgot all details, so I had to find a keyboard with a functional key.) Anyway, here is the tested patch that indeed needed to reset up_modifier. Sorry for the delay. diff --git a/src/term.c b/src/term.c index 871734318c..a3aef31ec2 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: diff --git a/src/xdisp.c b/src/xdisp.c index 53300928d7..516013ce4b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13516,6 +13516,10 @@ tty_handle_tab_bar_click (struct frame *f, int x, int y, bool down_p, f->last_tab_bar_item = prop_idx; else { + /* Force reset of up_modifier bit from the event modifiers. */ + if (event->modifiers & up_modifier) + event->modifiers &= ~up_modifier; + /* Generate a TAB_BAR_EVENT event. */ Lisp_Object frame; Lisp_Object key = AREF (f->tab_bar_items,