From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#5721: Feature request: Function that returns absolute coordinates Date: Sun, 29 Sep 2013 12:26:40 +0200 Message-ID: <52480060.7020309@gmx.at> References: <4B9E4521.9030909@yahoo.co.jp> <87fvsoemnj.fsf@hochschule-trier.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1380450441 31934 80.91.229.3 (29 Sep 2013 10:27:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 29 Sep 2013 10:27:21 +0000 (UTC) Cc: 5721@debbugs.gnu.org To: Andreas Politz Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 29 12:27:22 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 1VQEDh-0006GP-RU for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Sep 2013 12:27:22 +0200 Original-Received: from localhost ([::1]:44144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQEDh-0006kZ-BW for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Sep 2013 06:27:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQEDW-0006kD-W3 for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2013 06:27:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQEDP-000840-Mx for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2013 06:27:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQEDP-00083u-Iy for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2013 06:27:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VQEDO-0000Fy-0m for bug-gnu-emacs@gnu.org; Sun, 29 Sep 2013 06:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Sep 2013 10:27:01 +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.1380450412972 (code B ref 5721); Sun, 29 Sep 2013 10:27:01 +0000 Original-Received: (at 5721) by debbugs.gnu.org; 29 Sep 2013 10:26:52 +0000 Original-Received: from localhost ([127.0.0.1]:44442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQEDC-0000FY-72 for submit@debbugs.gnu.org; Sun, 29 Sep 2013 06:26:50 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:63404) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQED8-0000FM-DB for 5721@debbugs.gnu.org; Sun, 29 Sep 2013 06:26:47 -0400 Original-Received: from [62.47.43.39] ([62.47.43.39]) by mail.gmx.com (mrgmx002) with ESMTPA (Nemesis) id 0M08ia-1VgwkS3s0C-00uJs0 for <5721@debbugs.gnu.org>; Sun, 29 Sep 2013 12:26:45 +0200 In-Reply-To: <87fvsoemnj.fsf@hochschule-trier.de> X-Provags-ID: V03:K0:vWqSuCI0HZT/VS6v8H4jsHxjRS1OCON9oGPle9GdhuuLEHPZfOX TRzHwPPj5uXIOvIlKi4aNYWJLJ5W/UHJafABbot+GwJf4iKmwSCKSCSrHfVNHXbqGG0QmSN VHm19hqt2jkXnmtIXIiW4n9IJAKTz93UFZp8NeulJxpHbjFD+w0payMQU4Jp0weXTfyXDwE EnN/gGTGvqWMJby7FgvRQ== 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:78793 Archived-At: > I'd like the request to be reopened, because the current function > `window-inside-absolute-pixel-edges' does not provide the requested > behaviour. I think your analysis is correct but will leave it to Jan to decide how to proceed. > 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 | | | | > | | | +---------+ | | | > | | +------------------------+ | | > | *----------------------------* | > | | > *--------------------------------------* Where did/do we put the internal borders of the frame? > We have a buffer position D = > (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)) > = (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. 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? > 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) = (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. martin