From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#28620: Interact directly on Emacs bug#28620: mouse drag event records wrong release window Date: Wed, 4 Oct 2017 23:09:01 +0100 Message-ID: <20171004220901.GA52814@breton.holly.idiocy.org> References: <8360bw19es.fsf@gnu.org> <20171003224017.GA51637@breton.holly.idiocy.org> <20171004163048.GA52414@breton.holly.idiocy.org> <20171004185900.GA52514@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1507155013 21952 195.159.176.226 (4 Oct 2017 22:10:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Oct 2017 22:10:13 +0000 (UTC) User-Agent: Mutt/1.9.0 (2017-09-02) Cc: 28620@debbugs.gnu.org To: rswgnu@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 05 00:10:06 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1dzrrh-0004m3-Mq for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Oct 2017 00:10:05 +0200 Original-Received: from localhost ([::1]:37011 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzrro-0000lk-So for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Oct 2017 18:10:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzrri-0000jA-TZ for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 18:10:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzrre-00041u-UZ for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 18:10:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40755) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzrre-00041o-Pq for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 18:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dzrre-0008PR-HB for bug-gnu-emacs@gnu.org; Wed, 04 Oct 2017 18:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Oct 2017 22:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28620 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28620-submit@debbugs.gnu.org id=B28620.150715495432260 (code B ref 28620); Wed, 04 Oct 2017 22:10:02 +0000 Original-Received: (at 28620) by debbugs.gnu.org; 4 Oct 2017 22:09:14 +0000 Original-Received: from localhost ([127.0.0.1]:49436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzrqs-0008OG-1J for submit@debbugs.gnu.org; Wed, 04 Oct 2017 18:09:14 -0400 Original-Received: from mail-wm0-f53.google.com ([74.125.82.53]:43154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzrqo-0008Nz-LL for 28620@debbugs.gnu.org; Wed, 04 Oct 2017 18:09:13 -0400 Original-Received: by mail-wm0-f53.google.com with SMTP id m72so15835362wmc.0 for <28620@debbugs.gnu.org>; Wed, 04 Oct 2017 15:09:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=AhOMM8hRJFDQdk5UfRUrCwSUfLZxj6dCQv0QEoOvt0A=; b=dSQdjWqno6igUPrY2mbPIsF6yUihjKfmJSXohwUZ4Fi1YZwbZrhQBu6P0EPq6tCG+5 LZutIvt+PB6sKTllHFuTlKcIm331IuE3evCWZz6nC87roFWmoCIEAO8Zyshry2AJAscQ 0K/7z2Sn0DlFbGaoKOglvtUC5B5oaNFtr+Cgzja4wMh/KinrZrzTHJuX7oo/tOuqFfhe UY+WPzGvKmYoSv+xHfEFKCjquy10Vnui5LAqCph2xbZ9k+liAzR6mitZmRLND8Vo0SZd S1d59H1y31h0ulDjHK3jyYa1ZphKRZ9Yji66LP/f/rB/IEQvBKSb7jnv53p8IofjupRA fQ5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=AhOMM8hRJFDQdk5UfRUrCwSUfLZxj6dCQv0QEoOvt0A=; b=n8qr5iGcOpaFWbjZwtAfoIz18cBIaSC7TCrOjha2rrr9X9KwB90HZywcOFtLvdkwCM 6bxaf3dCIAnpzjF12PZsPCAv1GXhc41iZtYFVYVAB6gmvH26+grkyaPy9vnt21YdQT+A dqFEyER8BJKnPimWcwlG4Jf8yp8xHCA6HGZlv+Nu+iMg2j4WCj37hQQDeqovOVLcEmA/ QJ0wMdGlymA20XOYYEu9AwGwG06+S5l556WkVvkExiSdahatDPstk2c6gRvmqgaAM9lL 3eaykQc40BpIghEUYqpqdzuY6DPg2FFyIjc8ugVQpc1NF8XKCGWV7gJy4KWN7ds3HVbW nHtA== X-Gm-Message-State: AMCzsaVzWD5gIafZHV4+9dvJV6mtL36KizAHIpChAHS4Pk2sHKu8wM8n xBSukyypP1/ytGSqo40ohEo= X-Google-Smtp-Source: AOwi7QBeqamZndyxfI8F2iDK2HIg+Eyt78SHssaylToLKhP8bYOdnoxkMxVQ+FqySnN1dT/K/rqs8Q== X-Received: by 10.28.208.129 with SMTP id h123mr9611794wmg.25.1507154944915; Wed, 04 Oct 2017 15:09:04 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-ad89-e054-05c6-3eca.holly.idiocy.org. [2001:8b0:3f8:8129:ad89:e054:5c6:3eca]) by smtp.gmail.com with ESMTPSA id 193sm13310108wmh.47.2017.10.04.15.09.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Oct 2017 15:09:03 -0700 (PDT) Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137925 Archived-At: On Wed, Oct 04, 2017 at 04:07:56PM -0400, Robert Weiner wrote: > On Wed, Oct 4, 2017 at 2:59 PM, Alan Third wrote: > > > > > It looks like there’s maybe a neater way to get the current frame > > under the mouse... > > > > Lisp_Object frame = Qnil; > > NSWindow *w = [NSApp windowWithWindowNumber: > > [NSWindow windowNumberAtPoint:[NSEvent > > mouseLocation] > > belowWindowWithWindowNumber:0]]; > > if (w != nil) > > XSETFRAME (frame, ((EmacsView *)[w delegate])->emacsframe); > > > > > The ​mouseDown​ function (called by the various mouseUp functions) uses > `emacsframe' to set the appropriate frame. > How does the above modify emacsframe? Doesn't XSETFRAME just set the value > of the local `frame'? Yes. You can’t modify emacsframe because it’s an instance variable. You’ll need to modify whatever is using it to set the frame in the emacs event. So, assuming the code you’re modifying is calling EV_TRAILER, for now, replace the call to EV_TRAILER with it’s contents: XSETFRAME (emacs_event->frame_or_window, emacsframe); EV_TRAILER2 (e); and work from there. -- Alan Third