[Top][All Lists]

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

Re: Raising the Emacs frame in response to a DBUS signal

From: Tassilo Horn
Subject: Re: Raising the Emacs frame in response to a DBUS signal
Date: Mon, 30 May 2016 13:53:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

cesar mena <address@hidden> writes:

Hi Cesar,

> see if the below advise works for you.  it uses wmctrl to raise the
> frame.  there's an explanation in the gmane article linked in the
> comment.

Well, using wmctrl would most probably work but we can't really depend
on external programs which might not be installed anyway.

That said, the function used to work as intended for me on Gnome and
also for that other user on XFCE.  Of course, it might be that something
else lead to this problem, e.g., a change in X or GTK+.  But how can I

What's not explainable to me is that evaluating

    (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?


reply via email to

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