From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Newsgroups: gmane.emacs.bugs Subject: bug#5721: Feature request: Function that returns absolute coordinates Date: Fri, 16 Jul 2010 08:38:44 +0200 Message-ID: <4C3FFE74.2090602@swipnet.se> References: <4B9E4521.9030909@yahoo.co.jp> <4C2C8C02.1010906@swipnet.se> <4C2D9009.60405@swipnet.se> <4C3DD633.7040004@swipnet.se> <4C3EA59E.40300@swipnet.se> <4C3EBDAD.1040800@swipnet.se> <4C3EC17E.6060101@swipnet.se> <4C3EC863.3030803@swipnet.se> <4C3ECE08.2040604@swipnet.se> <4C3ED669.1020607@swipnet.se> <4C3EE966.5050704@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1279263640 16314 80.91.229.12 (16 Jul 2010 07:00:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 16 Jul 2010 07:00:40 +0000 (UTC) Cc: 5721@debbugs.gnu.org To: YAMAMOTO Mitsuharu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 16 09:00:39 2010 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.69) (envelope-from ) id 1OZeuS-0004BB-6i for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Jul 2010 09:00:36 +0200 Original-Received: from localhost ([127.0.0.1]:40724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZeuR-00006w-HF for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Jul 2010 03:00:35 -0400 Original-Received: from [140.186.70.92] (port=52735 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZeuH-00005O-VP for bug-gnu-emacs@gnu.org; Fri, 16 Jul 2010 03:00:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OZeuG-000102-GH for bug-gnu-emacs@gnu.org; Fri, 16 Jul 2010 03:00:26 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40102) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZeuG-0000zy-Es for bug-gnu-emacs@gnu.org; Fri, 16 Jul 2010 03:00:24 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OZeZa-0000oL-2h; Fri, 16 Jul 2010 02:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Jul 2010 06:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5721 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5721-submit@debbugs.gnu.org id=B5721.12792623243110 (code B ref 5721); Fri, 16 Jul 2010 06:39:02 +0000 Original-Received: (at 5721) by debbugs.gnu.org; 16 Jul 2010 06:38:44 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZeZH-0000o7-7m for submit@debbugs.gnu.org; Fri, 16 Jul 2010 02:38:44 -0400 Original-Received: from smtprelay-b11.telenor.se ([62.127.194.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZeZE-0000o2-RH for 5721@debbugs.gnu.org; Fri, 16 Jul 2010 02:38:41 -0400 Original-Received: from ipb3.telenor.se (ipb3.telenor.se [195.54.127.166]) by smtprelay-b11.telenor.se (Postfix) with ESMTP id 9B47CEA4F4 for <5721@debbugs.gnu.org>; Fri, 16 Jul 2010 08:38:52 +0200 (CEST) X-SENDER-IP: [85.225.45.35] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Avw7AOqaP0xV4S0jPGdsb2JhbACHcJd6DAEBAQE1Lb5QgnAIgiwEkg4 X-IronPort-AV: E=Sophos;i="4.55,213,1278280800"; d="scan'208";a="548442986" Original-Received: from c-232de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.35]) by ipb3.telenor.se with ESMTP; 16 Jul 2010 08:38:47 +0200 Original-Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 7D6D67FA05A; Fri, 16 Jul 2010 08:38:45 +0200 (CEST) User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.4) Gecko/20100608 Thunderbird/3.1 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 16 Jul 2010 02:39:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , 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:38576 Archived-At: YAMAMOTO Mitsuharu skrev 2010-07-16 02.35: >>>>>> On Thu, 15 Jul 2010 12:56:38 +0200, Jan Dj=E4rv said: > >>> It seems to be difficult to reach agreement about absolete unscaled >>> vs. absolute scaled. Fortunately, that doesn't matter for X11 >>> currently, and we agree with the necessity of a special function >>> that returns absolute unscaled coordinates to pass to an external >>> program. Why don't we start discussing the specification of that >>> special function, letting absolute unscaled vs. absolute scaled >>> aside for now? >>> >>> My proposal was to make it parallel to posn-at-x-y, as I mentioned. >>> >>> (posn-at-x-y x y&optional frame-or-window whole) >>> > >> Sure. Please check the ifdefs in the window absolute functions I >> made to see the various differences w.r.t tool bar and menu bar. > > I don't think such ifdefs are necessary. The strategy I'm thinking of > is: > > 1) Convert window coordinates to frame coordinates if the third > argument is not a frame. This should be similar to the code in > pos-at-x-y. AFAIK, there is no pos-at-x-y function. Did you mean posn-at-x-y? > 2) Call a terminal-specific function that converts frame-relative > coordinates to absolute coordinates. That can be done by the > following "idiom". > > x +=3D f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f); > y +=3D f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f); > > on X11 and > > ClientToScreen (FRAME_W32_WINDOW (f),&pt) > > on W32, I guess. You left out Nextstep/OSX. > > By the way, window-(inside-)absolute-pixel-edges doesn't seem to take > account of title bar height. Is that correct? Why should it? The titlebar isn't an Emacs window in X, it belongs to th= e=20 window manager. Top/left does not point at it, it points at the Emacs fr= ame. Jan D.