emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: input-pending-p after make-frame-visible


From: Aaron Jensen
Subject: Re: input-pending-p after make-frame-visible
Date: Wed, 29 Sep 2021 08:16:32 -0400

On Tue, Sep 28, 2021 at 1:50 AM Eli Zaretskii <eliz@gnu.org> wrote:
> But where does that M-x come from in the recipe in question?

Unfortunately my recipe at the moment involves a couple third party
packages. M-x is what I hit to trigger M-x, with mini-frame enabled,
which is what produces the problem. Specifically it's something about
how mini-frame raises the child frame that causes input-pending-p to
become t

On Wed, Sep 29, 2021 at 5:28 AM martin rudalics <rudalics@gmx.at> wrote:
> Could you please try to tell in a few sentences what you did and what
> happened so maybe someone else can understand the issue and chime in.
> I'm meanwhile completely lost.

Also, unfortunately, my recipe involves using Emacs normally for a day
or so with my configuration until the issue starts to manifest itself.
I'm not the only person with this same problem, but no one else has a
repro either.

This is the code that evaluates, with make-frame-visible being the
thing that changes the value of input-pending-p:

(defun mini-frame--display (fn args)
  "Show mini-frame and call FN with ARGS."
  (let* ((selected-frame (selected-frame))
         (selected-window (selected-window))
         (selected-is-mini-frame (memq selected-frame
                                       (list mini-frame-frame
                                             mini-frame-completions-frame)))
         (dd default-directory)
         (parent-frame-parameters `((parent-frame . ,(unless
mini-frame-standalone
                                                       selected-frame))))
         (show-parameters (if (functionp mini-frame-show-parameters)
                              (funcall mini-frame-show-parameters)
                            mini-frame-show-parameters))
         (show-parameters (append (unless (alist-get 'background-color
show-parameters)
                                    `((background-color . ,(funcall
mini-frame-background-color-function))))
                                  show-parameters)))
    (if (frame-live-p mini-frame-frame)
        (unless selected-is-mini-frame
          (setq mini-frame-selected-frame selected-frame)
          (setq mini-frame-selected-window selected-window)
          (modify-frame-parameters mini-frame-frame parent-frame-parameters))
      (setq mini-frame-selected-frame selected-frame)
      (setq mini-frame-selected-window selected-window)
      (setq mini-frame-frame
            (mini-frame--make-frame (append '((minibuffer . only))
                                            parent-frame-parameters
                                            show-parameters))))
    (mini-frame--move-frame-to-frame mini-frame-frame mini-frame-selected-frame)
    (modify-frame-parameters mini-frame-frame show-parameters)
    (when (and (frame-live-p mini-frame-completions-frame)
               (frame-visible-p mini-frame-completions-frame))
      (make-frame-invisible mini-frame-completions-frame))
    (message "before: %S" (input-pending-p))
    (make-frame-visible mini-frame-frame)
    (message "after: %S" (input-pending-p))
    (redirect-frame-focus mini-frame-selected-frame mini-frame-frame)
    (select-frame-set-input-focus mini-frame-frame)
    (setq default-directory dd)
    (apply fn args)))

On Wed, Sep 29, 2021 at 8:06 AM Eli Zaretskii <eliz@gnu.org> wrote:
> Can this be done from GDB instead?

For me, it'd be lldb. Would putting a breakpoint in input-pending-p
tell us anything?

Aaron



reply via email to

[Prev in Thread] Current Thread [Next in Thread]