title: mate desktop environment marco window manager window focus not working
body: <p>I am running :</p>
  <pre><code>fedora32
  mate desktop environment
  wayland
  marco window manager
  xterm
  emacs -nw (text mode)
  emacs dired+ mode
  emacs &quot;openwith&quot; mode
  </code></pre>
  <p>When I start up &quot;emacs -nw&quot; in the xterm it uses &quot;dired+&quot; mode to give a directory listing.
  The emacs &quot;openwith&quot; package has associations for &quot;.pdf&quot; and other file extensions.
  What &quot;openwith&quot; does is when I put the cursor on a line in the directory listing
  and press &quot;f&quot; or &quot;v&quot; to find or view the file, openwith launches an external program
  (e.g. &quot;okular&quot;) to view the pdf file.</p>
  <p>The problem is that when the external program (e.g. &quot;okular&quot;) exits,
  the window manager focus does not return to the xterm running emacs.
  This does not only happen with this pair of programs (xterm and okular).
  In general, when you exit a program
  (any program, not just one launched from emacs and xterm as described above),
  you can not rely on the window focus returning to where you last were.<br />
  It is annoying.
  I am pretty sure there used to be some kind of stack holding the window focus
  so it would return to the previously focused windows in turn.</p>
  <p>This problem is not present in mate with the compiz window manager, but that
  has other problems.</p>