From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] emacs-25 d4e1549: Guard terminal parameter in XTerm mouse mode Date: Wed, 23 Nov 2016 17:09:30 +0000 Message-ID: References: <20161122204222.29398.86534@vcs.savannah.gnu.org> <20161122204222.DBE712201C5@vcs.savannah.gnu.org> <83bmx66vkg.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114074686193150541faf473 X-Trace: blaine.gmane.org 1479922227 3009 195.159.176.226 (23 Nov 2016 17:30:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 23 Nov 2016 17:30:27 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 23 18:30:21 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c9bNF-00082g-9h for ged-emacs-devel@m.gmane.org; Wed, 23 Nov 2016 18:30:21 +0100 Original-Received: from localhost ([::1]:35294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9bNI-0004ED-UP for ged-emacs-devel@m.gmane.org; Wed, 23 Nov 2016 12:30:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9b3J-0005XC-80 for emacs-devel@gnu.org; Wed, 23 Nov 2016 12:09:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9b3I-0008Cd-1N for emacs-devel@gnu.org; Wed, 23 Nov 2016 12:09:45 -0500 Original-Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:36752) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c9b3H-0008Au-F1 for emacs-devel@gnu.org; Wed, 23 Nov 2016 12:09:43 -0500 Original-Received: by mail-lf0-x22f.google.com with SMTP id t196so9001579lff.3 for ; Wed, 23 Nov 2016 09:09:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=G/JV4xxpCwq+eSjvt0HdX8BB5mlbcts0+7HhPueaQyA=; b=QSq3pU5uDycdqLiEAIrWj4tg6B/5Rznv8cDuGLOI9bcClxvyFK9J3k0xV6xUHR6u/x WrP4Erpt6DlHl/nL3J7tds1gPY4hxzJJbLV/V0ojMTgjjSjzNitruvfVMWiF75sRoqvl vP5DvhyM0Fs4BxT+PIObHsu687nlW3AaXpWmZYJRqaADUfdTfasu7JqPLkbSjRoAGz0Y h4uv6ilQWBUk/0vIBqt1+iPcxrUE4L6C6T2+Pi1hymAtV1pdeixhKkUObTTAY0O8ZZwe IQwylLNlGXQ/qnllJ+tjeI00i+JAe8FIP69mYUbb4kDXf5/bDxUy34PiCfucskvelY54 nr6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=G/JV4xxpCwq+eSjvt0HdX8BB5mlbcts0+7HhPueaQyA=; b=f6kte56pBCNEsH2yZuqltFOCcUXv+YewqouyEpJIs7A+DdiKjTwHmEYUaToy1eQ0RG vCSbUeBihcGShMzRZzs1sMCXNAAj9NyuOeDfFxw0QjfJj9WzJcY63sfQjuh8DKN0rnK6 oWS1gZNkWesp8800Eq+T1zLyOPiTJSi0P/uoLpHuYg8kYcGQIwhexPpAWiOSGWA5V+Uj CJJcdT5bUbyhsPepZ1FZLru2CJcwhzu/gAntFM4UnRShBPg26684wJ52G4lkq8hMB3/E SVOU27tTpNIujUAzNuvfIgQ59p5ChOy5DrOE9f8e8Oy06nEkRX7fDP2aNjOKokENz7aU rDVA== X-Gm-Message-State: AKaTC00o5hvkxLe74h04qKPEmubwET0fL/6n3cFRtktUw8yyf93OosHA3rzu2s4wJAfmmazlWOz4aXZJPXVM1UUQ X-Received: by 10.25.157.5 with SMTP id g5mr1191075lfe.112.1479920981182; Wed, 23 Nov 2016 09:09:41 -0800 (PST) In-Reply-To: <83bmx66vkg.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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:209573 Archived-At: --001a114074686193150541faf473 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii schrieb am Mi., 23. Nov. 2016 um 16:54 Uhr: > > From: Philipp Stephani > > Date: Wed, 23 Nov 2016 12:20:16 +0000 > > > > Stefan Monnier schrieb am Mi., 23. Nov. 2016 > um 02:08 Uhr: > > > > > + (setf (terminal-parameter nil 'xterm-mouse-last-down) > > > + ;; EVENT might be handed back to the input queue, which > > > + ;; might modify it. Copy it into the terminal parameter > > > + ;; to guard against that. > > > + (copy-sequence event)) > > > > Do you have further information about when/where events might be > > modified in place? It sounds like a risky operation. > > > > I assume it's in the code that translates consecutive mouse-down events > to mouse-movement events. It's > > easy to reproduce in HTerm: without the patch, dragging the mouse while > holding a button causes > > "drag-mouse-0" events to be generated. These come from spurious > mouse-movement events in > > xterm-mouse-last-down. Since nothing places these events explicitly > there, the root cause must be that the > > event list is overwritten. > > Agreed that the input loop probably shouldn't modify event objects. But > it might be a necessary optimization > > somewhere. Unfortunately I wasn't able to find the specific piece of > code responsible for this modification. > > Does this have to be applied to the release branch? If so, can you > tell why? > It's a very annoying and highly visible bug, and the fix is trivial and cannot possibly break anything. --=20 Google Germany GmbH Erika-Mann-Stra=C3=9Fe 33 80636 M=C3=BCnchen Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Gesch=C3=A4ftsf=C3=BChrer: Matthew Scott Sucherman, Paul Terence Manicle Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und l=C3=B6schen Sie die E-Mail und alle Anh=C3=A4nge. Vielen Dank. This e-mail is confidential. If you are not the right addressee please do not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks. --001a114074686193150541faf473 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= Mi., 23. Nov. 2016 um 16:54=C2=A0Uhr:
> From: Philipp Stephani <phst@google.com>
> Date: Wed, 23 Nov 2016 12:20:16 +0000
>
> Stefan Monnier <monnier@iro.umontreal.ca> sc= hrieb am Mi., 23. Nov. 2016 um 02:08 Uhr:
>
>=C2=A0 > + (setf (terminal-parameter nil 'xterm-mouse-last-down)=
>=C2=A0 > + ;; EVENT might be handed back to the input queue, which >=C2=A0 > + ;; might modify it. Copy it into the terminal parameter >=C2=A0 > + ;; to guard against that.
>=C2=A0 > + (copy-sequence event))
>
>=C2=A0 Do you have further information about when/where events might be=
>=C2=A0 modified in place? It sounds like a risky operation.
>
> I assume it's in the code that translates consecutive mouse-down e= vents to mouse-movement events. It's
> easy to reproduce in HTerm: without the patch, dragging the mouse whil= e holding a button causes
> "drag-mouse-0" events to be generated. These come from spuri= ous mouse-movement events in
> xterm-mouse-last-down. Since nothing places these events explicitly th= ere, the root cause must be that the
> event list is overwritten.
> Agreed that the input loop probably shouldn't modify event objects= . But it might be a necessary optimization
> somewhere. Unfortunately I wasn't able to find the specific piece = of code responsible for this modification.

Does this have to be applied to the release branch?=C2=A0 If so, can you tell why?

It's = a very annoying and highly visible bug, and the fix is trivial and cannot p= ossibly break anything.=C2=A0
--

G= oogle Germany GmbH
Erika-Mann-Stra=C3=9Fe 33
80636 M=C3=BCnchen

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Gesch=C3=A4ftsf=C3=BChrer: Matthew Scott Sucherman, Paul Terence Manicle

Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Ad= ressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absen= der und l=C3=B6schen Sie die E-Mail und alle Anh=C3=A4nge. Vielen Dank.

This e-mail is confidential. If you are not the right addres= see please do not forward it, please inform the sender, and please erase th= is e-mail including any attachments. Thanks.

--001a114074686193150541faf473--