all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: "Óscar Fuentes" <ofv@wanadoo.es>
Cc: 22549@debbugs.gnu.org
Subject: bug#22549: 25.0.50; Tooltips placed outside of screen limits
Date: Sat, 06 Feb 2016 10:30:38 +0100	[thread overview]
Message-ID: <56B5BD3E.1000305@gmx.at> (raw)
In-Reply-To: <87d1sa23cj.fsf@wanadoo.es>

 > The first problem with the patch is that it crashes when there is not an
 > Emacs frame on some of the monitors. This is solved changing the `if'
 > to:
 >
 >            if (CONSP (frames) && !NILP (XCDR (frames))
 >                && EQ (frame, XCAR (XCDR (frames))))

Silly me.  I was looking for Fcadr, didn't find it and just grabbed
whatever there was without thinking of the consequences.

Translating code back from Elisp to C is a PITA.  And I don't want to
tear apart ‘x-display-monitor-attributes-list’ for the present purpose,
especially not on Emacs-25.  Maybe I can convince Yamamoto Mitsuharu to
provide a C-friendly interface for master.

 > The next problem is that the condition
 >
 > EQ (frame, XCAR (XCDR (frames)))
 >
 > is always false, which makes sense because `frame' is the tooltip frame
 > (unless I'm misunderstanding what XSETFRAME does) and it is not listed
 > on `frames'.

Another silliness.  With GTK, FRAME is the original frame and I stepped
through this with GDB on a GTK build only and it obviously worked.  With
Lucid, FRAME is the tooltip frame and I just looked at the results which
were OK since I have only one monitor.

 > For going ahead I "corrected" this with
 >
 >        struct frame *sf = XFRAME (selected_frame);
 >        XSETFRAME (frame, sf);
 >
 > which is wrong when there is more than one frame, because the tooltip
 > may be shown for a frame that is not the selected one (showing tooltips
 > for other than the selected frame seems inappropriate to me, but that's
 > how Emacs behaves right now).

Maybe someone will find a use case for it.  Let's not bother now but
simply agree that the selected frame might be on another monitor and so
could be the wrong frame.

 > Then, as the comparision only takes into account the first frame listed
 > on `frames', even if `frame' where correct (the frame that triggered the
 > tooltip) it could fail when there is more than one Emacs frame on the
 > same monitor.

I don't understand you here.  There can be any number of frames on the
"right" monitor.  The important thing is to get the monitor of the frame
where the tooltip shall be shown.

 > I observed that the tooltip is correctly placed when the right
 > conditions (see below) are satisfied.
 >
 > What is missing is to determine the parent frame of the tooltip frame,

... that's the one passed via FRAME to ‘x-show-tip’ and we just have to
pass it on to compute_tip_xy ...

 > instead of using just the selected one as I did, and to search for that
 > frame on the list of frames associated to the current monitor, instead
 > of just testing the first frame on the list.

martin






  reply	other threads:[~2016-02-06  9:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-04  4:05 bug#22549: 25.0.50; Tooltips placed outside of screen limits Óscar Fuentes
2016-02-04 15:55 ` martin rudalics
2016-02-04 16:20   ` Óscar Fuentes
2016-02-04 16:43     ` Eli Zaretskii
2016-02-04 17:05     ` martin rudalics
2016-02-04 19:16       ` Óscar Fuentes
2016-02-05 17:44         ` martin rudalics
2016-02-05 22:34           ` Óscar Fuentes
2016-02-06  9:30             ` martin rudalics [this message]
2016-02-05 23:52           ` Óscar Fuentes
2016-02-06  9:30             ` martin rudalics
2016-02-06 17:06               ` Óscar Fuentes
2016-02-06 18:09                 ` martin rudalics
2016-02-06 18:52                   ` Óscar Fuentes
2016-02-06 19:44                     ` martin rudalics
2016-02-06 19:49                       ` martin rudalics
2016-02-06 20:34                         ` Óscar Fuentes
2016-02-06 21:23                           ` Óscar Fuentes
2016-02-06 22:56                             ` martin rudalics
2016-02-06 23:22                               ` Óscar Fuentes

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=56B5BD3E.1000305@gmx.at \
    --to=rudalics@gmx.at \
    --cc=22549@debbugs.gnu.org \
    --cc=ofv@wanadoo.es \
    /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.