all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Selecting tooltip frames considered harmful
Date: Sun, 25 Feb 2018 20:08:35 +0100	[thread overview]
Message-ID: <5A9309B3.1050405@gmx.at> (raw)
In-Reply-To: <83inam4qlj.fsf@gnu.org>

 >> (1) Ignore the message in message3_nolog (the ideal solution but maybe
 >>       too simplistic).
{...]
 > I think we should do (1) and document it.

I'd tend to agree but I'm not sure whether the story will end here.

First of all I have to mention that the toy examples I presented will
hardly occur in practice.  Moreover, they could be easily fixed by
making 'visible-frame-list' not return a tooltip frame (and thus
always return a subset of the elements returned by 'frame-list') and
by having 'next-frame' and 'previous-frame' never return a tooltip
frame either.  This way the user should no longer be enabled to select
a tooltip frame from Elisp.

The problem did happen in practice here because I started implementing
a feature that allows mouse drags to cross frame boundaries.  This
means that when processing a MotionNotify event which is currently
handled as

	f = (x_mouse_grabbed (dpyinfo) ? dpyinfo->last_mouse_frame
	     : x_window_to_frame (dpyinfo, event->xmotion.window));

I have to set f to the frame specified by the event window instead of
the last mouse frame.  If I now show a tooltip frame during mouse
tracking (as 'mouse-drag-and-drop-region' does by default), that event
frame happens to be a tooltip frame surprisingly often, in particular
with the Lucid build.

I resolved this problem by never choosing a tooltip frame in the
scenario above (and a few related ones) but always go to the initially
grabbed frame instead.  Still I wonder whether the problem with a
selected tooltip frame might arise in practice and whether we should
do something about it.

Unfortunately, when we allow selecting a tooltip frame (1) is not
sufficient since Emacs will crash immediately afterwards - xdisp.c has
message_with_string, vmessage, setup_echo_area_for_printing,
redisplay_internal, see

	internal_condition_case_1 (redisplay_window_1,
				   FRAME_MINIBUF_WINDOW (sf), list_of_error,
				   redisplay_window_error);

and

       Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf);
       struct frame *mini_frame = XFRAME (WINDOW_FRAME (XWINDOW (mini_window)));

all silently assuming that the selected frame has a minibuffer window.
So the necessary changes are quite substantial.  And obviously the
abort in minibuffer.c I cited earlier

       /* I don't think that any frames may validly have a null minibuffer
	 window anymore.  */
       if (NILP (sf->minibuffer_window))
	emacs_abort ();

is even more difficult to handle.

martin



  reply	other threads:[~2018-02-25 19:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-24  9:52 Selecting tooltip frames considered harmful martin rudalics
2018-02-24 10:41 ` Eli Zaretskii
2018-02-25 19:08   ` martin rudalics [this message]
2018-02-25 19:55     ` Eli Zaretskii
2018-02-26  9:05       ` martin rudalics
2018-02-26 15:50         ` Eli Zaretskii
2018-02-26 18:54           ` martin rudalics
2018-02-26 19:31             ` Eli Zaretskii
2018-02-27  2:57               ` Stefan Monnier
2018-02-25 13:33 ` Stefan Monnier
2018-02-25 19:08   ` martin rudalics
2018-02-26  3:02     ` Stefan Monnier
2018-02-26  9:06       ` martin rudalics
2018-02-26 13:21         ` Stefan Monnier
2018-02-26 18:54           ` martin rudalics

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=5A9309B3.1050405@gmx.at \
    --to=rudalics@gmx.at \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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.