2

The lisp function start-process is meant to start an asynchronous subprocess, namely a process running independently of Emacs itself.

I have noticed that, under my GNOME desktop environment, when my subprocess opens another window, the focus is transferred to that other window, even if the mouse pointer remains over the portion of my emacs window visible outside the subprocess window.

I believe I am able to programmatically transfer the focus back to the emacs window using the Unix utility wmctrl, but for the sake of elegance, I would much prefer to avoid doing this extra work.

Hence my question:

Question. Is it possible to start an asynchronous process whose window does not steal the focus from Emacs?

PS: I have attempted to replace start-process with call-process (with the DESTINATION parameter set to 0), but the problem persists!

Drew
  • 75,699
  • 9
  • 109
  • 225
Ruy
  • 787
  • 4
  • 11
  • 1
    I think this is a question about the desktop environment, not about emacs. You should probably ask the question in the Unix & Linux SE. – NickD Aug 21 '21 at 20:32
  • This is definitely a question about configuring your window manager, and not anything to do with Emacs. – db48x Aug 22 '21 at 06:14
  • Thanks to Nick and @db48x for your suggestions. You both are quite likely on the right path, but unfortunately I wasn't able to follow your lead. My Gnome window manager offers 2 options for creating new windows, namely "smart" and "strict" but neither changes that undesirable behavior. – Ruy Aug 22 '21 at 19:42
  • Yea, Gnome has gotten a lot less configurable over the years. You should look into alternative window managers. There are hundreds of them, and most of them will work as drop–in replacements for the Gnome window manager (called mutter, iirc) while allowing you to retain the rest of the Gnome Desktop Environment. Perhaps one or more of them will behave how you want. – db48x Aug 23 '21 at 05:12

0 Answers0