From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Newsgroups: gmane.emacs.bugs Subject: bug#24085: 25.1.50; `make-frame' given `top' param creates frame with ~10x smaller `top' Date: Wed, 27 Jul 2016 22:12:08 -0400 Message-ID: <6dbee9a6-bfe3-7d29-d3a0-1a5521e3c73f@gmail.com> References: <<<<0bfd2e8d-9d9b-4737-a637-5175eaaf41c0@default> <57987CBA.2060405@gmx.at> <<<<3657859c-03f1-4eca-9a78-a9be0dee6552@default> <<<<83h9bbrqx5.fsf@gnu.org> <<<06a3fb2a-b975-41cf-8aa3-c2cbe207057f@default> <<<838twnrngr.fsf@gnu.org> <<325b79e8-c40b-46f7-a89a-11f0888b0a68@default> <<8360rqsy7i.fsf@gnu.org> <6336b8b4-49c0-4ce6-9044-cf558f12c16e@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="23BS8iSCRmq9u1qPbhQM00x8fRsNiAt73" X-Trace: ger.gmane.org 1469672013 28935 80.91.229.3 (28 Jul 2016 02:13:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Jul 2016 02:13:33 +0000 (UTC) To: 24085@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 28 04:13:16 2016 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 1bSap0-0001fG-4t for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Jul 2016 04:13:14 +0200 Original-Received: from localhost ([::1]:50459 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSaoz-0002nW-6x for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Jul 2016 22:13:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSaos-0002lB-LN for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2016 22:13:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSaoo-0002Fy-DS for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2016 22:13:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSaoo-0002Fu-AL for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2016 22:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bSaoo-0001qH-51 for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2016 22:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Jul 2016 02:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24085 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14696719697061 (code B ref -1); Thu, 28 Jul 2016 02:13:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Jul 2016 02:12:49 +0000 Original-Received: from localhost ([127.0.0.1]:48656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSaob-0001pp-4U for submit@debbugs.gnu.org; Wed, 27 Jul 2016 22:12:49 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSaoZ-0001pZ-0A for submit@debbugs.gnu.org; Wed, 27 Jul 2016 22:12:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSaoR-0002BE-VR for submit@debbugs.gnu.org; Wed, 27 Jul 2016 22:12:41 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:39582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSaoR-0002B3-SA for submit@debbugs.gnu.org; Wed, 27 Jul 2016 22:12:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSaoP-0002RT-5U for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2016 22:12:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSaoK-000299-Pe for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2016 22:12:35 -0400 Original-Received: from mout.kundenserver.de ([212.227.17.13]:54688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSaoK-00028v-FI for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2016 22:12:32 -0400 Original-Received: from [18.189.62.146] ([18.189.62.146]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0MUEy2-1btRJV0s6M-00QxLJ; Thu, 28 Jul 2016 04:12:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 In-Reply-To: <6336b8b4-49c0-4ce6-9044-cf558f12c16e@default> X-Provags-ID: V03:K0:73O071935cjbn8dOOyz9OFdBcmgo+9Yn9wrru94JnFVIQ0rMhr1 kCwtMGfVKQSCTUBlRA6vTytccPB+SJj4sC8Aey2W5/jwygec+r3NiCo2+ooiLkjX/eDwIdg 5i1XQxWmZCxtA21hvkyMFT+g5O6A2H3JRooKE+bqpEICtu9RGY/3BqUudJbnBXKHKwAjFt3 Ec5D95m4I9dEVZbr+dAcA== X-UI-Out-Filterresults: notjunk:1;V01:K0:gQzrRzcK81M=:R+sgiQdv7+VF9iHP+ye0T8 4As8FuKwv4kU96ZmKD8JwYLIB+YnDXryNG3Wr6rt9HfyP9dKA24eqrQS4MDNszrknb2Y+a3wc 1J7WbRhwI0sqd2+zwUU5H6fbN72LSiBCdYWU3HFuA7vcKiXDhdEl065ZBN0xgNiUj6kZMcIEP 5jtScy+6oIenYDPO/d1I+LOP/sNDfaYPslqRpuKeswdhTfXjW7EUr9Q5AAjlc0RUYJUCO4NwY uNLBa0OCLOk/9l1IMedICDTdHzIcSi7eEbSrEuw1aNVCmBlOv4cgela/BgdCD74DSI8xYbSsC sNUONAcyNLZtOi6xkQCFuzbKvJ2hdosulnQhz4P70FWzW7f2bF+Zj3dAwq5jjfmI/8vCc4aYR GCvy7hWWj0x5IZRsrs1AWV2KQluYNyrWDZb5QJV/DnKPpB/p2qEmuuiU8T06skMSVvRHkw4mx 1tcwf+oXQ7zFMzBOt/tytN+VrSdK5B+kTIHyemfGU5DRYQJgbxdhntP6JZJrDFXbE8fpknNe2 z4XedMA+0QmPyKbmBDeWeipqMiI4ebvKcDa4+9tji4uOXMZdc/ickOeUsJ0rhIciLnNxAElMA JSjYew+HWVx94DXBd8PjRpgAeR9f2+cp8NPP76mhWQviMqqivENzdFPaCZPk5GjSLY9VbNlk9 W7Kx1S4771sJT9FPeyaLtyND5kUt1ZI1BErYAtl8/+oNBrBkkffZPCuHRWy96+tPnhnA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:121610 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --23BS8iSCRmq9u1qPbhQM00x8fRsNiAt73 Content-Type: multipart/mixed; boundary="ovr6WAQWECvOsHrUqoKrXB0eJlKTN6SUp" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: bug-gnu-emacs@gnu.org Cc: Drew Adams Message-ID: <6dbee9a6-bfe3-7d29-d3a0-1a5521e3c73f@gmail.com> Subject: Re: bug#24085: 25.1.50; `make-frame' given `top' param creates frame with ~10x smaller `top' References: <<<<0bfd2e8d-9d9b-4737-a637-5175eaaf41c0@default> <57987CBA.2060405@gmx.at> <<<<3657859c-03f1-4eca-9a78-a9be0dee6552@default> <<<<83h9bbrqx5.fsf@gnu.org> <<<06a3fb2a-b975-41cf-8aa3-c2cbe207057f@default> <<<838twnrngr.fsf@gnu.org> <<325b79e8-c40b-46f7-a89a-11f0888b0a68@default> <<8360rqsy7i.fsf@gnu.org> <6336b8b4-49c0-4ce6-9044-cf558f12c16e@default> In-Reply-To: <6336b8b4-49c0-4ce6-9044-cf558f12c16e@default> --ovr6WAQWECvOsHrUqoKrXB0eJlKTN6SUp Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016-07-27 16:55, Drew Adams wrote: > Just hoping I'm missing something simple, like a function > `screen-relative-x-y-pixels-at-point'... Thanks, if you can > point the way. Hey Drew, There was a discussion about this on the Wiki page for pos-tip (back then= you suggested filing an enhancement request). The following function, fr= om pos-tip.el, seems to do more or less what you're looking for. Does it?= I'm not sure how well it works in Windows. In any case, it would be nice if this was easily feasible. Cheers, Cl=E9ment. (defun pos-tip-compute-pixel-position (&optional pos window pixel-width pixel-height frame-coordinates dx dy)= "Return pixel position of POS in WINDOW like (X . Y), which indicates the absolute or relative coordinates of bottom left corner of the object.= Omitting POS and WINDOW means use current position and selected window, respectively. If PIXEL-WIDTH and PIXEL-HEIGHT are given, this function assumes these values as the size of small window like tooltip which is located around t= he object at POS. These values are used to adjust the location in order that= the tooltip won't disappear by sticking out of the display. By referring the variable `pos-tip-upperside-p' after calling this function, user can examine whether the tooltip will be located above the specified position.= If FRAME-COORDINATES is omitted or nil, automatically obtain the absolute= coordinates of the top left corner of frame which WINDOW is on. Here, `top left corner of frame' represents the origin of `window-pixel-edges' and its coordinates are essential for calculating the return value as absolute coordinates. If a cons cell like (LEFT . TOP), specifies the frame absolute location and makes the calculation slightly faster, but ca= n be used only when it's clear that frame is in the specified position. Use= rs can get the latest values of frame coordinates for using in the next call= by referring the variable `pos-tip-saved-frame-coordinates' just after calling this function. Otherwise, FRAME-COORDINATES `relative' means retu= rn pixel coordinates of the object relative to the top left corner of the fr= ame. This is the same effect as `pos-tip-use-relative-coordinates' is non-nil.= DX specifies horizontal offset in pixel. DY specifies vertical offset in pixel. This makes the calculations done without considering the height of object at POS, so the object might be hidden by the tooltip." (let* ((frame (window-frame (or window (selected-window)))) (w32-frame (eq (pos-tip-window-system frame) 'w32)) (relative (or pos-tip-use-relative-coordinates (eq frame-coordinates 'relative) (and w32-frame (null pos-tip-w32-saved-max-width-height)))) (frame-coord (or (and relative '(0 . 0)) frame-coordinates (pos-tip-frame-top-left-coordinates frame) (progn (setq relative t pos-tip-use-relative-coordinates t) '(0 . 0)))) (posn (posn-at-point (or pos (window-point window)) window)) (line (cdr (posn-actual-col-row posn))) (line-height (and line (or (window-line-height line window) (and (redisplay t) (window-line-height line window))))) (x-y (or (posn-x-y posn) (let ((geom (pos-visible-in-window-p (or pos (window-point window)) window t))) (and geom (cons (car geom) (cadr geom)))) '(0 . 0))) (x (+ (car frame-coord) (car (window-inside-pixel-edges window)) (car x-y) (or dx 0))) (y0 (+ (cdr frame-coord) (cadr (window-pixel-edges window)) (or (nth 2 line-height) (cdr x-y)))) (y (+ y0 (or dy (car line-height) (with-current-buffer (window-buffer window) (cond ;; `posn-object-width-height' returns an incorrect value ;; when the header line is displayed (Emacs bug #4426). ((and posn (null header-line-format)) (cdr (posn-object-width-height posn))) ((and (bound-and-true-p text-scale-mode) (not (zerop (with-no-warnings text-scale-mode-amount)))) (round (* (frame-char-height frame) (with-no-warnings (expt text-scale-mode-step text-scale-mode-amount))))) (t (frame-char-height frame))))))) xmax ymax) (cond (relative (setq xmax (frame-pixel-width frame) ymax (frame-pixel-height frame))) (w32-frame (setq xmax (car pos-tip-w32-saved-max-width-height) ymax (cdr pos-tip-w32-saved-max-width-height))) (t (setq xmax (x-display-pixel-width frame) ymax (x-display-pixel-height frame)))) (setq pos-tip-upperside-p (> (+ y (or pixel-height 0)) ymax)) (cons (max 0 (min x (- xmax (or pixel-width 0)))) (max 0 (if pos-tip-upperside-p (- (if dy ymax y0) (or pixel-height 0)) y))))) (defun pos-tip-w32-max-width-height (&optional keep-maximize) "Maximize the currently selected frame temporarily and set `pos-tip-w32-saved-max-width-height' the effective display size in order to become possible to calculate the absolute location of tooltip. KEEP-MAXIMIZE non-nil means leave the frame maximized. Note that this function is usable only in Emacs 23 for MS-Windows." (interactive) (unless (eq window-system 'w32) (error "`pos-tip-w32-max-width-height' can be used only in w32 frame.= ")) ;; Maximize frame (with-no-warnings (w32-send-sys-command 61488)) (sit-for 0) (let ((offset (pos-tip-calibrate-frame-offset))) (prog1 (setq pos-tip-w32-saved-max-width-height (cons (frame-pixel-width) (+ (frame-pixel-height) (- (cdr offset) (car offset))))) (if (called-interactively-p 'interactive) (message "%S" pos-tip-w32-saved-max-width-height)) (unless keep-maximize ;; Restore frame (with-no-warnings (w32-send-sys-command 61728)))))) --ovr6WAQWECvOsHrUqoKrXB0eJlKTN6SUp-- --23BS8iSCRmq9u1qPbhQM00x8fRsNiAt73 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXmWn4AAoJEPqg+cTm90wjJP8P/jUXtHBNjx6d0GnC8M2JGnK7 G2QixvcGrW97pbkMnpWZR5SQFVTMsfL6cPRqKIVpbvAjl3lR5pUsYKn/BwqSuHwv sLVF6X9Wx0nxYt6/neRujfGwhcLF4BwOtodbrYgThS18HpoDBi7bxrHgo8KzyksE O/QXT/ffFYQhlTP7hgAG1BIgIZbouIXt7BhXLmylA9bKrXfEQHWbx4wV8CD5fUEC zRMd5ctEGWCjGgTtwNcMOQSHMADhxwrkRgln3IvxD1LoTM4EAYDA+2i3xXyVxavo vcBhL2dmtEezquCI0rEAML9eFE/9E6Bs1gUE3B+j22Ait7r24Y+g+0H21S7btiCb D+7PRU/qacbfmgAfk0rYZhpJmL3cq6qqFa53boHXphlXSX13imTjaEmIH4ZWwIIn Y1+FP2xC0RK7qdDQba4cb1hr8dD7ShwIb4XXaEgQHMhMwvU3+2rxjOsMIxPT+cxh LS6y1e6dtuaGDnvOhMuaTacFpdCByDx+m266l3Wse0tXFBuXyIgTJPYTTKZk8rAN fmyM4w5LMXKhASbh1RrvTSkCh6LUKhjtgTwHmaFnibwpERg7HxaOboiQV7HJH6cv dDsG+1+qSsVf8iFlEElZ54JyvZefBW799JHLKiqiYj09G6Tn6aIp9+50ZL4zJU7p WFxuYc6NwhsjDtEp/Llk =wBVN -----END PGP SIGNATURE----- --23BS8iSCRmq9u1qPbhQM00x8fRsNiAt73--