all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
[parent not found: <<831t2dsu3y.fsf@gnu.org>]
* Display-relative coordinates
@ 2016-07-28 14:41 Eli Zaretskii
  2016-07-28 19:07 ` martin rudalics
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2016-07-28 14:41 UTC (permalink / raw)
  To: emacs-devel

Moved here from bug-gnu-emacs.

> 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?).



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-07-29 17:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <<<831t2dsu3y.fsf@gnu.org>
     [not found] ` <<bd748cdc-2ab2-4576-9e85-1040706ffcc8@default>
     [not found]   ` <<83d1lwr2at.fsf@gnu.org>
2016-07-29 15:38     ` Display-relative coordinates Drew Adams
2016-07-29 17:42       ` Eli Zaretskii
     [not found] <<831t2dsu3y.fsf@gnu.org>
2016-07-28 20:20 ` Drew Adams
2016-07-29 13:39   ` Eli Zaretskii
2016-07-28 14:41 Eli Zaretskii
2016-07-28 19:07 ` martin rudalics
2016-07-28 20:20   ` Drew Adams
2016-07-29  5:54     ` martin rudalics
2016-07-29 15:38       ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.