From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Display-relative coordinates Date: Thu, 28 Jul 2016 21:07:55 +0200 Message-ID: <579A580B.9010507@gmx.at> References: <831t2dsu3y.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1469733433 21785 80.91.229.3 (28 Jul 2016 19:17:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Jul 2016 19:17:13 +0000 (UTC) To: Eli Zaretskii , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 28 21:17:02 2016 Return-path: Envelope-to: ged-emacs-devel@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 1bSqnk-0007Ql-1t for ged-emacs-devel@m.gmane.org; Thu, 28 Jul 2016 21:17:00 +0200 Original-Received: from localhost ([::1]:55258 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSqnd-0005iu-Tj for ged-emacs-devel@m.gmane.org; Thu, 28 Jul 2016 15:16:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSqf7-0008MF-4O for emacs-devel@gnu.org; Thu, 28 Jul 2016 15:08:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSqf6-0003EI-6M for emacs-devel@gnu.org; Thu, 28 Jul 2016 15:08:05 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:49961) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSqf1-0003DN-5f; Thu, 28 Jul 2016 15:07:59 -0400 Original-Received: from [192.168.1.101] ([212.95.7.84]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0M3RZI-1bBJqI1fTU-00qwD8; Thu, 28 Jul 2016 21:07:58 +0200 In-Reply-To: <831t2dsu3y.fsf@gnu.org> X-Provags-ID: V03:K0:Ka3o3qcOoHo4XOkgfFI2QFUbtQrR3ntgL0T1RUyKZlQ3g7ob4Ja 21JB0Q/48q1xScCxSv6uHNGMcnNrquvxxMuLWY2jIsUc5v0NtgBcDZDXAXNworcXjs5D0Ag AIvvklzsoZ2d6okrK87MpKf4HdARWzNc539BVAPQOsPcngjeccuIfN5Fqv38hR+A0S06LUS x1k7smULJZR8B+rL5WcfA== X-UI-Out-Filterresults: notjunk:1;V01:K0:SsTZmBCnrk0=:/FAoDojjJ5p91m0F8yf/Sc ZlPeo4DCzZxBpOIrR7svBV1pFDqkKXCipRD77CgbGnuKuqVR011ZrkeyXN8WrGtaF8wwONkYu KgedsLeNleFAYF93C5tLXbKZ7XjWvsUrJqORi27k2exmXelBsnjpcpt4+DwqjVlQC/3jqVTlI C5LvkV6O1cDydP6AV476pS4JLTQ1xc0O+ICVDGsTTv0zQGyoYGo+2mQvzEC9/ku5gXuNzBAGl XGuk7qDpYfQ/BeEh/ZORrwowI1WW/jRQmKYMkvj56hHXqcV9kV9TO0KmUDzSjLVn/lMB0tFqi D+Qyf5d2iX3gsZPOSoIOfLkbJmRiZvgDxzBVuHXht8yV5LxfGHbfbZ4+f7JenGuUFqf2rzuFC 54+ccCT/E2OZhL3gVGAmBBRkxTWD+Xjz4iwGpdJGsTieBXrHoZDVWqwNJp+/QPhWN5YYoPOBE Xnl6J5n8ZjxMWYO0zBe1cTQIUYJIe+lzE1KIe+dE0FuE8IaR5kwI0LgTFLUxBXf2pioNivL+O 7/gdwT34CPbEJ9jhGQyqbnBxLVs/OkFk+70NlIdULzIo4wEvotYdVzNTn06bdXDk3dr92xBrP I9eHeRZoa35MTp/uTLZ7Z2jcv7hhLPJDF+EQdHdot51A5lwcG5/oYYyUEbmjUGUfcvLH53weN iTpbjee2JOcdhIvbZY6bBpRUueI7H2s0y3A3Y8mHCK4f50Pq8NZYqqHBRI6JQ01Q3eF8hott1 KJEcbNuycVB3hNbT9+ikV9z8qWIDn7dmMhxM5TTb3twWylUpnl6WmYoNjayzwjLywfz2VGRw X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.15 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:206213 Archived-At: >> I've been fiddling a bit with test code like this, but haven't >> really found anything reasonable yet: > >> ;; Try to get screen-relative X, Y (pixels) for current point >> (let* ((posn-at-pt (posn-at-point)) >> (x-y (and posn-at-pt (posn-x-y posn-at-pt))) >> (win-edges (and x-y (window-inside-absolute-pixel-edges)))= >> (x (and x-y (+ (car x-y) (car win-edges)))) >> (y (and x-y (+ (cdr x-y) (cadr win-edges)))) >> (y (and y (top-fudge-pixels y)))) >> ...) > >> (defun top-fudge-pixels (y) >> (let ((y2 y)) >> (when tool-bar-mode (setq y2 (+ 40 tp))) >> (when menu-bar-mode (setq y2 (+ 25 tp))) >> (setq y2 (+ y2 28)) ; Frame title bar >> y2)) > > What are the problems you see with the above (except that 'tp' is a > void variable)? It looks OK to me, modulo the kludges in > top-fudge-pixels (why not use frame-geometry, which exists for that > purpose?). FWIW =E2=80=98window-inside-absolute-pixel-edges=E2=80=99 didn't work on = Windows before Emacs 25. On Emacs 25 =E2=80=98window-absolute-pixel-position=E2=80=99 i= s all that's needed. martin