mirror of
https://github.com/norohind/EDMC_SpanshRouter.git
synced 2026-10-22 02:01:19 +03:00
Merge pull request #15 from wuuthradd/fix/wl-copy-issue-wayland
Fix: Keyboard input loss on Wayland after clipboard copy
This commit is contained in:
1 file changed
+7
-3
@@ -375,11 +375,15 @@ class SpanshRouter():
|
||||
logger.warning(''.join('!! ' + line for line in lines))
|
||||
|
||||
def copy_waypoint(self):
|
||||
if sys.platform == "linux" or sys.platform == "linux2":
|
||||
if sys.platform in ("linux", "linux2"):
|
||||
clipboard_cli = os.getenv("EDMC_SPANSH_ROUTER_XCLIP") or "xclip -selection c"
|
||||
clipboard_cli = clipboard_cli.split()
|
||||
command = subprocess.Popen(["echo", "-n", self.next_stop], stdout=subprocess.PIPE)
|
||||
subprocess.Popen(clipboard_cli, stdin=command.stdout)
|
||||
subprocess.run(
|
||||
clipboard_cli,
|
||||
input=self.next_stop.encode(),
|
||||
timeout=5,
|
||||
check=False,
|
||||
)
|
||||
else:
|
||||
self.parent.clipboard_clear()
|
||||
self.parent.clipboard_append(self.next_stop)
|
||||
|
||||
Reference in new issue
Block a user