From: "Jan Djärv" <jan.h.d@swipnet.se>
To: martin rudalics <rudalics@gmx.at>
Cc: 5721@debbugs.gnu.org, Andreas Politz <politza@hochschule-trier.de>
Subject: bug#5721: Feature request: Function that returns absolute coordinates
Date: Sun, 29 Sep 2013 17:59:04 +0200 [thread overview]
Message-ID: <AD386D1A-7F09-49B7-9BE6-3A6133087292@swipnet.se> (raw)
In-Reply-To: <52480060.7020309@gmx.at>
29 sep 2013 kl. 12:26 skrev martin rudalics <rudalics@gmx.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.
>
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.
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 | | | |
> > | | | +---------+ | | |
> > | | +------------------------+ | |
> > | *----------------------------* |
> > | |
> > *--------------------------------------*
>
> 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
>
>
prev parent reply other threads:[~2013-09-29 15:59 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-15 14:33 bug#5721: Feature request: Function that returns absolute coordinates IRIE Shinsuke
2010-03-30 17:50 ` Jan Djärv
2010-05-31 10:28 ` IRIE Shinsuke
2010-06-01 1:16 ` YAMAMOTO Mitsuharu
2010-07-02 2:10 ` YAMAMOTO Mitsuharu
2010-07-02 7:06 ` Jan Djärv
2010-07-02 9:15 ` YAMAMOTO Mitsuharu
2010-07-14 15:22 ` Jan Djärv
2010-07-15 0:17 ` YAMAMOTO Mitsuharu
2010-07-15 6:07 ` Jan Djärv
2010-07-15 6:49 ` YAMAMOTO Mitsuharu
2010-07-15 7:50 ` Jan Djärv
2010-07-15 7:59 ` YAMAMOTO Mitsuharu
2010-07-15 8:06 ` Jan Djärv
2010-07-15 8:18 ` YAMAMOTO Mitsuharu
2010-07-15 8:35 ` Jan Djärv
2010-07-15 8:44 ` YAMAMOTO Mitsuharu
2010-07-15 8:59 ` Jan Djärv
2010-07-15 9:27 ` YAMAMOTO Mitsuharu
2010-07-15 9:35 ` Jan Djärv
2010-07-15 9:38 ` YAMAMOTO Mitsuharu
2010-07-15 10:32 ` Jan Djärv
2010-07-16 0:25 ` YAMAMOTO Mitsuharu
2010-07-16 6:39 ` Jan Djärv
2010-07-16 9:14 ` YAMAMOTO Mitsuharu
2010-07-16 12:20 ` Jan Djärv
2010-07-15 9:57 ` YAMAMOTO Mitsuharu
2010-07-15 10:56 ` Jan Djärv
2010-07-16 0:35 ` YAMAMOTO Mitsuharu
2010-07-16 6:38 ` Jan Djärv
2010-07-16 8:37 ` YAMAMOTO Mitsuharu
2010-07-16 8:49 ` Jan Djärv
2010-07-16 8:58 ` YAMAMOTO Mitsuharu
2010-07-16 12:19 ` Jan Djärv
2010-07-17 0:30 ` YAMAMOTO Mitsuharu
2010-07-17 5:32 ` YAMAMOTO Mitsuharu
2010-07-17 8:37 ` Jan Djärv
2010-07-17 8:42 ` YAMAMOTO Mitsuharu
2010-07-01 12:37 ` Jan Djärv
2010-07-01 16:52 ` bug#5721: Feature request: Function that returnsabsolute coordinates Drew Adams
2010-07-01 17:20 ` Jan Djärv
2010-07-01 17:27 ` Drew Adams
2010-07-01 18:26 ` Jan Djärv
2010-07-01 18:52 ` Drew Adams
2010-07-01 20:08 ` Juanma Barranquero
2010-07-01 22:05 ` Lennart Borgman
[not found] ` <87r5jn148f.wl%irieshinsuke@yahoo.co.jp>
2010-07-01 18:14 ` bug#5721: Feature request: Function that returns absolute coordinates Jan Djärv
2010-07-02 0:33 ` MON KEY
2013-09-28 20:06 ` Andreas Politz
2013-09-29 10:26 ` martin rudalics
2013-09-29 15:41 ` Andreas Politz
2013-09-29 16:02 ` Jan Djärv
2013-09-29 16:05 ` Jan Djärv
2013-09-29 17:21 ` Andreas Politz
2013-09-29 18:09 ` Jan Djärv
2013-09-29 18:47 ` martin rudalics
2013-09-29 18:47 ` martin rudalics
2013-09-29 20:10 ` Jan Djärv
2013-10-03 17:25 ` Andreas Politz
2013-10-03 20:25 ` Eli Zaretskii
2013-10-03 21:09 ` Andreas Politz
2013-10-04 6:47 ` Eli Zaretskii
2013-10-04 8:28 ` Andreas Politz
2013-10-04 8:55 ` Eli Zaretskii
2013-10-04 10:33 ` Andreas Politz
2013-09-29 18:46 ` martin rudalics
2013-09-29 20:25 ` Andreas Politz
2013-09-29 15:59 ` Jan Djärv [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AD386D1A-7F09-49B7-9BE6-3A6133087292@swipnet.se \
--to=jan.h.d@swipnet.se \
--cc=5721@debbugs.gnu.org \
--cc=politza@hochschule-trier.de \
--cc=rudalics@gmx.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.