all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: cesar mena <cesar.mena@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Raising the Emacs frame in response to a DBUS signal
Date: Mon, 30 May 2016 13:53:51 +0200	[thread overview]
Message-ID: <87a8j792y8.fsf@gnu.org> (raw)
In-Reply-To: <8737ozkcb9.fsf@cmena.pobox.com> (cesar mena's message of "Mon, 30 May 2016 07:36:10 -0400")

cesar mena <cesar.mena@gmail.com> 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
know?

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?

Bye,
Tassilo



  reply	other threads:[~2016-05-30 11:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-30  7:47 Raising the Emacs frame in response to a DBUS signal Tassilo Horn
2016-05-30 11:36 ` cesar mena
2016-05-30 11:53   ` Tassilo Horn [this message]
2016-06-04  7:34     ` Eli Zaretskii
2016-06-04 12:59       ` Tassilo Horn

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=87a8j792y8.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=cesar.mena@gmail.com \
    --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.