12

In Ubuntu 17.04 I could use wmctrl to switch to a gnome-terminal window with given window ID:

wmctrl -ia $gnome_term_winid

The window ID of a given gnome-terminal could also be displayed from the terminal by typing:

echo $WINDOWID

After upgrading to Ubuntu 17.10, this is no longer the case. First, echo $WINDOWID gives nothing, and also wmctrl -lx does not show any gnome-terminal windows.

Håkon Hægland
  • 3,843
  • 12
  • 44
  • 78
  • 2
    Thanks, I reported [bug 1725991 on Launchpad](https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/1725991) about that. – N0rbert Oct 22 '17 at 12:31

1 Answers1

10

wmctrl doesn't work properly in a Wayland session as controlling windows is against Wayland's security policy.

wmctrl may work with the application windows running under the XWayland compatibility layer (for example Firefox). But gnome-terminal is an official GNOME app which doesn't run under XWayland so it fails.

You may try to switch to an Xorg session as a workaround.

pomsky
  • 67,112
  • 21
  • 233
  • 243
  • 2
    There are some proposed protocols to support it in general way in wayland, but not one is working on it yet. Really is a shame, i can not concidered a wayland protocol ready to go on linux until this problem will not be resolved. A lot of apps are not working because of this. https://stackoverflow.com/questions/45465016/how-do-i-get-the-active-window-on-gnome-wayland/46557325 – lestcape Jan 07 '18 at 03:04