From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wolfgang Lux Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#1791: 23.0.60; Emacs.app may process events in wrong window Date: Mon, 5 Jan 2009 21:57:42 +0100 Message-ID: <0A9924B3-BD99-44C7-A910-752BE89E956C@gmail.com> Reply-To: Wolfgang Lux , 1791@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: multipart/mixed; boundary=Apple-Mail-1--521208054 X-Trace: ger.gmane.org 1231190620 17878 80.91.229.12 (5 Jan 2009 21:23:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Jan 2009 21:23:40 +0000 (UTC) To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 05 22:24:50 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LJwwL-00013f-Jc for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Jan 2009 22:24:50 +0100 Original-Received: from localhost ([127.0.0.1]:60876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJwv5-0005ux-Sw for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Jan 2009 16:23:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LJwv2-0005uc-5P for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 16:23:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LJwv1-0005uI-HG for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 16:23:27 -0500 Original-Received: from [199.232.76.173] (port=57975 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJwv1-0005uF-D1 for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 16:23:27 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:39451) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LJwv0-0005rD-P4 for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 16:23:27 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n05LNNhG002832; Mon, 5 Jan 2009 13:23:24 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n05L55pe030726; Mon, 5 Jan 2009 13:05:05 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Wolfgang Lux Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 05 Jan 2009 21:05:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 1791 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123118905328661 (code B ref -1); Mon, 05 Jan 2009 21:05:05 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 5 Jan 2009 20:57:33 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n05KvTPY028655 for ; Mon, 5 Jan 2009 12:57:30 -0800 Original-Received: from mx10.gnu.org ([199.232.76.166]:34483) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LJwUl-0002gv-B1 for emacs-pretest-bug@gnu.org; Mon, 05 Jan 2009 15:56:19 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LJwVs-00039G-8e for emacs-pretest-bug@gnu.org; Mon, 05 Jan 2009 15:57:28 -0500 Original-Received: from fg-out-1718.google.com ([72.14.220.158]:58548) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LJwVr-000392-Jq for emacs-pretest-bug@gnu.org; Mon, 05 Jan 2009 15:57:28 -0500 Original-Received: by fg-out-1718.google.com with SMTP id l26so2870520fgb.30 for ; Mon, 05 Jan 2009 12:57:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:mime-version:to:message-id :content-type:from:subject:date:x-mailer; bh=92zaaUraxRSiIUIIOs8IvuSDPwSdf3iM1nbTEgJIEaQ=; b=VSMYxmCEwT5Y6RKGM8tO6hFmD/WyUVvVPCuZVsqcuiXIz7bzm/eezQmqTIH7j9Ldg+ Y3Asu7cnBxXEkfsBqPhkTn8Tedn/SH3Vw7kPfMzKMTRZQ6iqnN5uKQmnKC4/9pPFuKiy bJ6Tou1ozjI8QyU8aFMN/1cKo9PI60LfCPXGQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:to:message-id:content-type:from:subject:date:x-mailer; b=pxwL/+wfvBpW9ZqXz/aQIpBkdbQhkNq7lzGl/I1PpFjdpwcIkp1j64FvLv1TNhw/Jx JkM9PKChJr96D2KlI3H6EkWIkkGezVaIhnUZezjacGFThkOv1XZpbpVvHSP5ZLxmLaNo ktULH3x1wZ18hYU7e420mmINAoEhEumopvy5U= Original-Received: by 10.86.59.2 with SMTP id h2mr4752755fga.30.1231189045558; Mon, 05 Jan 2009 12:57:25 -0800 (PST) Original-Received: from ?212.144.125.107? (dialin-212-144-125-107.pools.arcor-ip.net [212.144.125.107]) by mx.google.com with ESMTPS id e11sm21646331fga.12.2009.01.05.12.57.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 05 Jan 2009 12:57:24 -0800 (PST) X-Mailer: Apple Mail (2.753.1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Mon, 05 Jan 2009 16:23:27 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:23801 gmane.emacs.pretest.bugs:23616 Archived-At: --Apple-Mail-1--521208054 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: If Emacs.app is not the active application, events are always processed by the front-most window of Emacs rather than the intended window. For instance, start Emacs.app and create a new frame via Ctrl-X 5 b . There are now two frames displaying buffers *GNU Emacs* (in the back) and *scratch* (in the front). At this point activate, another application and click the close button of the frame displaying the *GNU Emacs* buffer (i.e., the back one). Emacs.app will close the window displaying the *scratch* buffer instead. The same happens when dragging text. Thus, in the scenario above, bring Terminal.app or TextEdit.app to the front and drag some text onto the *GNU Emacs* buffer (the back one). The text will appear in the *scratch* buffer instead of the *GNU Emacs*. The problem seems to be the EV_TRAILER macro in nsterm.m which sends events to SELECTED_FRAME() (apparently, the front-most window of Emacs.app) when the application is not active. I cannot imagine a reason for this code and have attached the obvious patch to fix the bug. --Apple-Mail-1--521208054 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name=nsterm.patch Content-Disposition: attachment; filename=nsterm.patch Index: src/nsterm.m =================================================================== RCS file: /sources/emacs/emacs/src/nsterm.m,v retrieving revision 1.41 diff -u -r1.41 nsterm.m --- src/nsterm.m 2 Jan 2009 18:58:52 -0000 1.41 +++ src/nsterm.m 5 Jan 2009 20:56:09 -0000 @@ -288,8 +288,7 @@ methods. Maybe it should even be a function. */ #define EV_TRAILER(e) \ { \ - XSETFRAME (emacs_event->frame_or_window, [NSApp isActive] ? \ - emacsframe : SELECTED_FRAME ()); \ + XSETFRAME (emacs_event->frame_or_window, emacsframe); \ if (e) emacs_event->timestamp = EV_TIMESTAMP (e); \ n_emacs_events_pending++; \ kbd_buffer_store_event_hold (emacs_event, q_event_ptr); \ --Apple-Mail-1--521208054 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed In GNU Emacs 23.0.60.1 (powerpc-apple-darwin8.11.0, NS apple- appkit-824.48) of 2009-01-05 on Onyx.local Windowing system distributor `Apple', version 10.3.824 configured using `configure '--with-ns'' --Apple-Mail-1--521208054--