Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 35 additions & 33 deletions qubes/tests/integ/dispvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,39 +864,7 @@ def _handle_editor(self, winid, copy=False):
.replace(")", r"\)")
)
time.sleep(1)
if (
"gedit" in window_title
or "KWrite" in window_title
or "Mousepad" in window_title
or "Geany" in window_title
or "Text Editor" in window_title
):
subprocess.check_call(
["xdotool", "windowactivate", "--sync", winid]
)
if copy:
subprocess.check_call(
[
"xdotool",
"key",
"--window",
winid,
"key",
"ctrl+a",
"ctrl+c",
"ctrl+shift+c",
]
)
else:
subprocess.check_call(["xdotool", "type", "Test test 2"])
subprocess.check_call(
["xdotool", "key", "--window", winid, "key", "Return"]
)
time.sleep(0.5)
subprocess.check_call(["xdotool", "key", "ctrl+s"])
time.sleep(0.5)
subprocess.check_call(["xdotool", "key", "ctrl+q"])
elif "LibreOffice" in window_title:
if "LibreOffice" in window_title:
# wait for actual editor (we've got splash screen)
search = subprocess.Popen(
[
Expand Down Expand Up @@ -976,6 +944,40 @@ def _handle_editor(self, winid, copy=False):
subprocess.check_call(
["xdotool", "key", "Escape", "colon", "w", "q", "Return"]
)
elif (
"gedit" in window_title
or "KWrite" in window_title
or "Mousepad" in window_title
or "Geany" in window_title
or "Text Editor" in window_title
# FeatherPad (default in Whonix 18), no app name in the title...
or "test.txt" in window_title
):
subprocess.check_call(
["xdotool", "windowactivate", "--sync", winid]
)
if copy:
subprocess.check_call(
[
"xdotool",
"key",
"--window",
winid,
"key",
"ctrl+a",
"ctrl+c",
"ctrl+shift+c",
]
)
else:
subprocess.check_call(["xdotool", "type", "Test test 2"])
subprocess.check_call(
["xdotool", "key", "--window", winid, "key", "Return"]
)
time.sleep(0.5)
subprocess.check_call(["xdotool", "key", "ctrl+s"])
time.sleep(0.5)
subprocess.check_call(["xdotool", "key", "ctrl+q"])
else:
raise KeyError(window_title)

Expand Down