[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Raising the Emacs frame in response to a DBUS signal
From: |
Eli Zaretskii |
Subject: |
Re: Raising the Emacs frame in response to a DBUS signal |
Date: |
Sat, 04 Jun 2016 10:34:16 +0300 |
> From: Tassilo Horn <address@hidden>
> Date: Mon, 30 May 2016 13:53:51 +0200
> Cc: address@hidden
>
> What's not explainable to me is that evaluating
>
> (progn
> (sleep-for 5)
> (x-focus-frame (selected-frame)))
>
> in *scratch* will bring emacs to the front after I've covered it with
> other applications' windows, but when (x-focus-frame (selected-frame))
> is called by the handler function that processes the DBUS signal from
> Evince, it doesn't bring emacs to the front.
>
> Oh, here's news. If the AUCTeX handler function waits a second before
> calling `x-focus-frame', it works again.
>
> ;; This works!
> (run-at-time 1 nil
> (lambda ()
> (x-focus-frame (selected-frame))))
>
> Does anyone know what might be the problem? Maybe some "focus stealing
> policy" that prevents that an application is raised just a fraction of a
> second after something has been clicked in another application?
You are playing with window-manager policies and with the fact that a
request to raise a frame is not executed by it immediately. AFAIR,
this was always a grey area, and I don't think Emacs can do anything
about this that would work portably.
- Re: Raising the Emacs frame in response to a DBUS signal,
Eli Zaretskii <=