emacs-devel
[Top][All Lists]
Advanced

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

Re: Q on frame focus with MS Windows


From: Lennart Borgman
Subject: Re: Q on frame focus with MS Windows
Date: Wed, 26 Oct 2005 00:21:17 +0200
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Drew Adams wrote:

My understanding is that it is the MS Windows window-manager that
automatically selects/focusses the new frame, and that that cannot be
prevented from within Emacs. If there is a way to inhibit this behavior,
that would be even better than getting the focus back after it has been
given to the new frame.
I believe that the new w32 window can be created without getting the focus, but I am not sure. And it is a rather complex change that must be made.

But I don't understand what you are suggesting I do - at all.

      A workaround is maybe to use `after-make-frame-functions'?

I already mentioned that I tried that. What do you suggest I put in that
hook, concretely? I tried reselecting the original buffer/window/frame and
the minibuffer, none of which seemed to work.
Something like this (but it is a bit ugly):

(setq pop-up-frames          t
     default-frame-alist    '((minibuffer))
     minibuffer-frame-alist '((minibuffer . only)))

(define-key minibuffer-local-completion-map [down] 'foo)

(defvar this-frame nil)
(defun foo-focus-this(frame-dummy)
 (run-with-idle-timer 0.1
                      nil
                      'select-frame-set-input-focus
                      this-frame))

(defun foo () (interactive)
 (add-hook 'after-make-frame-functions 'foo-focus-this)
 (setq this-frame (selected-frame))
 (display-buffer (get-buffer-create "foo")))





reply via email to

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