summaryrefslogtreecommitdiffstats
path: root/core/modules/vmware-common/data
diff options
context:
space:
mode:
authorSimon Rettberg2024-11-22 11:35:43 +0100
committerSimon Rettberg2024-11-22 11:35:43 +0100
commit2b5ef5cf9b8f4d583f53614dc268672cb6943981 (patch)
treea8006f794b44e9f7a46da9fb04892bdf27b80ad9 /core/modules/vmware-common/data
parent[kiosk-chromium/kiosk-firefox] Add log messages to preload scripts (diff)
downloadmltk-2b5ef5cf9b8f4d583f53614dc268672cb6943981.tar.gz
mltk-2b5ef5cf9b8f4d583f53614dc268672cb6943981.tar.xz
mltk-2b5ef5cf9b8f4d583f53614dc268672cb6943981.zip
[vmware-common] Use alternate method to capture mouse on startup
The old method of sending Ctrl-G to vmware seems wonky on newer VMware versions: Sometimes, the guest OS receives a never-ending stream of G keypresses, until you press G on the keyboard. Try to capture the mouse by simulating a mouseclick instead.
Diffstat (limited to 'core/modules/vmware-common/data')
-rw-r--r--core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/run-virt.include19
1 files changed, 15 insertions, 4 deletions
diff --git a/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/run-virt.include b/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/run-virt.include
index 57b5ee6c..bf7bc908 100644
--- a/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/run-virt.include
+++ b/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/run-virt.include
@@ -53,13 +53,24 @@ run_plugin() {
# HACK: make the mouse disappear
(
- local WINDOWS="$(xdotool search --sync --name '.*VMware.*Player.*')"
+ local WINDOWS
+ for i in 2 2 2 1 1 1 0; do
+ WINDOWS="$(xdotool search --sync --name '.*VMware.*Player.*')"
+ [ -n "$WINDOWS" ] && break
+ sleep "$i"
+ done
isempty WINDOWS && writelog "Could not find any vmplayer windows."
for WINDOW in $WINDOWS; do
- xdotool set_desktop_for_window $WINDOW 0 || writelog "Could not move vmplayer to desktop 0"
- xdotool windowactivate --sync $WINDOW || writelog "Could not activate vmplayer window"
- xdotool key --delay 2000 --clearmodifiers ctrl+g || writelog "Could not send ctrl+g to vmplayer window"
+ xdotool set_desktop_for_window "$WINDOW" 0 || writelog "Could not move vmplayer to desktop 0"
+ sleep .01
+ xdotool windowactivate --sync "$WINDOW" || writelog "Could not activate vmplayer window"
+ sleep .01
done
+ wmctrl -s 0
+ sleep .01
+ xdotool mousemove --sync --polar 0 0 || writelog "Could not move mouse to center of screen"
+ sleep .01
+ xdotool click 1 || writelog "Could not click"
) &
# HACK: using the modified version of the wrapper script