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: Sun, 29 Sep 2013 17:59:04 +0200 Message-ID: References: <4B9E4521.9030909@yahoo.co.jp> <87fvsoemnj.fsf@hochschule-trier.de> <52480060.7020309@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1380470423 31664 80.91.229.3 (29 Sep 2013 16:00:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 29 Sep 2013 16:00:23 +0000 (UTC) Cc: 5721@debbugs.gnu.org, Andreas Politz To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 29 18:00:25 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VQJQ1-0005Dv-LC for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Sep 2013 18:00:25 +0200 Original-Received: from localhost ([::1]:45201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQJQ1-0002uN-AI for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Sep 2013 12:00:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQJPp-0002j3-07 for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2013 12:00:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQJPj-0007Om-3S for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2013 12:00:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQJPi-0007Od-ND for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2013 12:00:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VQJPh-0001mJ-53 for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2013 12:00:05 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Sep 2013 16:00:05 +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.13804703516712 (code B ref 5721); Sun, 29 Sep 2013 16:00:05 +0000 Original-Received: (at 5721) by debbugs.gnu.org; 29 Sep 2013 15:59:11 +0000 Original-Received: from localhost ([127.0.0.1]:44961 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQJOo-0001kB-4x for submit@debbugs.gnu.org; Sun, 29 Sep 2013 11:59:10 -0400 Original-Received: from mail01.bdtv.se ([176.10.222.34]:33703) by debbugs.gnu.org with smtp (Exim 4.80) (envelope-from ) id 1VQJOl-0001jz-6N for 5721@debbugs.gnu.org; Sun, 29 Sep 2013 11:59:08 -0400 Original-Received: (qmail 1157 invoked by uid 89); 29 Sep 2013 15:59:04 -0000 Original-Received: from h-46-59-42-57.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.57) by mail01.bdtv.se with ESMTPA; 29 Sep 2013 15:59:04 -0000 Original-Received: from [172.20.199.13] (unknown [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 74F4D1A01FF; Sun, 29 Sep 2013 15:59:04 +0000 (UTC) In-Reply-To: <52480060.7020309@gmx.at> X-Mailer: Apple Mail (2.1510) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:78801 Archived-At: 29 sep 2013 kl. 12:26 skrev martin rudalics : > > I'd like the request to be reopened, because the current function > > `window-inside-absolute-pixel-edges' does not provide the requested > > behaviour. >=20 > I think your analysis is correct but will leave it to Jan to decide = how > to proceed. >=20 I gave no opinion in the matter. I think it is a mistake to let users = access pixels. It worked fine with X and no toolkit or Lucid/Motif. = But nowdays, window manager do strange things and so does toolkits (Gtk+ = don't create separate windows for its widgets for example), so it is = almost impossible to get right.=20 Jan D. > > Suppose no fringes, and header-line. All considerations for a GTK = build. > > > > 0--------------------------------------* > > | display | > > | A----------------------------+ | > > | | emacs@foo.bar + | > > | |-B------------------------+ + | > > | | | toolbar | | | > > | | +------------------------+ | | > > | | | menubar | | | > > | | C------------------------+ | | > > | | | | | | > > | | | window | | | > > | | | D---------+ | | | > > | | | | tooltip | | | | > > | | | +---------+ | | | > > | | +------------------------+ | | > > | *----------------------------* | > > | | > > *--------------------------------------* >=20 > Where did/do we put the internal borders of the frame? >=20 > > We have a buffer position D =3D > > (D.x, D.y) in some window and want to display a tool-tip there. At = the > > moment, > > > > (posn-x-y (posn-at-point)) > > > > gives us a position relative to C, so we would need it's absolute > > position. > > > > But `window-absolute-pixel-edges' gives the absolute position of > > > > (C.x - (B.x - A.x), C.y - (B.y - A.y)) > > =3D (A.x , C.y - (B.y - A.y)) , > > > > that is, it does not account for the width and height (B - A) of the > > window managers decorations. Furthermore these sizes are unknown to = the > > lisp side, making it impossible to complete the desired task. >=20 > I'm not sure whether we can correctly retrieve the decorations always > and everywhere. But note that for maximized and full-screen frames > there usually are no outer borders and with full-screen frames there's > no titlebar either. How does your patch handle these? >=20 > > So it seems to me that `window-absolute-pixel-edges' should return = the > > absolute position of C, such that the tool-tip (or other frame) may = be > > positioned at C + D. > > > > I noticed, that the frame struct already has members x_pixels_diff = and > > y_pixels_diff, such that > > > > (x_pixels_diff, y_pixels_diff) =3D (B.x - A.x, B.y - A.y) , > > > > such that we may compute C with this values. So I propose extending > > `calc_absolute_offset' by adding these pixel_diff values. For GTK = this > > appears to be especially easy, since these diff values already = account > > for the tool-bar and menu-bar sizes. >=20 > martin >=20 >=20