Support bring to front for vnc and spice consoles on Linux. Fixes #3783

This commit is contained in:
grossmj
2026-04-05 22:40:18 +08:00
parent adb8d37a91
commit 5e225020e0

View File

@@ -750,8 +750,12 @@ class Node(BaseNode):
wmctrl_path = shutil.which("wmctrl")
if wmctrl_path:
try:
# use wmctrl to raise the window based on the node name (this doesn't work well with window having multiple tabs)
subprocess.run([wmctrl_path, "-Fa", self.name()], check=True, env=os.environ)
console_type = self.consoleType()
if console_type == "telnet":
# use wmctrl to raise the window based on the node name (this doesn't work well with window having multiple tabs)
subprocess.run([wmctrl_path, "-Fa", self.name()], check=True, env=os.environ)
else:
subprocess.run([wmctrl_path, "-a", '(' + self.name() + ')'], check=True, env=os.environ)
return True
except subprocess.CalledProcessError:
log.debug("Could not find window title '{}' to bring it to front".format(self.name()))