Switching to VirtualBox window
klayman opened this issue · 17 comments
Could you help jumping to a virtualbox guest OS window? Both the main window of virtualbox and the window of guest OS have the same WM_CLASS(STRING) = "Qt-subapplication", "VirtualBox"
, while the window name differs: WM_NAME(STRING) = "Oracle VM VirtualBox Manager"
(main) and WM_NAME(STRING) = "windows (snapshotname) [Running] - Oracle VM VirtualBox"
(guest OS). I'm trying to jump to the latter window with no luck.
Sure, I don't think that would be too difficult. I can probably get it done sometime in the next week or so.
I'm thinking that the WM_NAME
match should be in conjunction with the normal PID or WM_NAME
match. By that I mean if you run jumpapp -t "(snapshotname) [Running]" virtualbox
, Jumpapp will find all windows that would normally match "virtualbox" (by either PID or WM_CLASS
) AND of only those windows match any that have a WM_NAME
containing "(snapshotname) [Running]" virtualbox". Any thoughts about that?
I think there is no -t
option? If you meant jumpapp -i "(snapshotname) [Running]" virtualbox
, then this command is just launching new instance of virtualbox.
Sorry for the confusion, I was writing about how it should work, not how it works now. I'm proposing that I add a new -t
option that matches on WM_NAME
.
Got it ) Somehow I thought that -i
option is exactly to match by WM_NAME
.
Just as a follow-up: a workaround with just cycling through all windows with the "virtualbox" string in their command-name or WM_CLASS
would be fine for me. The problem is - I can't switch with jumpapp virtualbox
to any window except for the main (VM manager) window.
Oh, I see. You're having trouble jumping to the guest window at all.
From your description of the WM_CLASS
names, it sounds like everything should work fine on your computer. When I try it on my computer with VirtualBox, I have no problem cycling through all the guest VM windows.
To start, can you paste the output of wmctrl -lpx
when you have multiple VirtualBox windows open?
For reference, here's what my output looks like:
$ wmctrl -lpx
0x02000008 0 6844 gnome-terminal.Gnome-terminal rainer mlk@rainer:~
0x01a000ac -1 6686 desktop_window.Nemo rainer Desktop
0x02a0008a 0 17872 Navigator.Firefox rainer Switching to VirtualBox window · Issue #7 · mkropat/jumpapp - Mozilla Firefox
0x02e00003 0 18775 Qt-subapplication.VirtualBox rainer Oracle VM VirtualBox Manager
0x03200002 0 19816 Qt-subapplication.VirtualBox rainer aquilla [Running] - Oracle VM VirtualBox
Sure. The two lines corresponding to VirtualBox are very similar to your output:
0x04000003 0 11140 Qt-subapplication.VirtualBox dell.local Oracle VM VirtualBox Manager
0x04400053 0 11186 Qt-subapplication.VirtualBox dell.local windows (elog) [Running] - Oracle VM VirtualBox
Sorry for dropping the ball on this issue. I recently pushed an update to jumpapp that includes a new -L
option that lists matching windows. I added it in order to troubleshoot issues like this.
If you're still having the issue, would you mind running jumpapp -L virtualbox
for me?
For example, this is what the output looks like on my computer:
$ jumpapp -L virtualbox
Matched Windows [2]
0x02e00003 rainer 14828 0 VirtualBox: Oracle VM VirtualBox Manager
0x03200002 rainer 15808 0 VirtualBox: aquilla [Running] - Oracle VM VirtualBox
If the window you want isn't showing up in the output, that means that jumpapp is having trouble finding the window.
If the window you want does appear in the list, then try running wmctrl -ia <window_id>
. So in my example, I'd run: wmctrl -ia 0x03200002
. If that command doesn't activate the window, then that means wmctrl
is having a problem.
I have tried it with -L
option and jumpapp found only the main window:
$ jumpapp -L virtualbox
Matched Windows [1]
0x03200003 dell.local 2487 0 VirtualBox: Oracle VM VirtualBox Manager
If I close the VirtualBox Manager window, then jumpapp vitrualbox
returns
Error: found running process for 'virtualbox', but found no window to jump to
Weird. For some reason the WM_CLASS
match must not be working. I'm going to investigate some more later on and see why that might be. I may even end up having to add more debug options :)
I did some more investigation, but I just can't reproduce the issue. I tried simulating your computer by inserting in the output from your earlier comment into a modified copy of jumpapp. But when I ran it I got the expected output:
./jumpapp -L virtualbox
Matched Windows [2]
0x04000003 dell.local 11140 0 VirtualBox: Oracle VM VirtualBox Manager
0x04400053 dell.local 11186 0 VirtualBox: windows (elog) [Running] - Oracle VM VirtualBox
(Both windows are returned, not just the one.)
The only thing I can think is that there's something about your bash environment that's different from mine. If you post the output of bash --version
and shopt
, I can try to reproduce your exact environment, otherwise I'm out of ideas.
Here is the bash version:
$ bash --version
GNU bash, version 4.2.53(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
and shopt
output:
$ shopt
autocd off
cdable_vars off
cdspell off
checkhash off
checkjobs off
checkwinsize on
cmdhist on
compat31 off
compat32 off
compat40 off
compat41 off
direxpand off
dirspell off
dotglob off
execfail off
expand_aliases on
extdebug off
extglob on
extquote on
failglob off
force_fignore on
globstar off
gnu_errfmt off
histappend on
histreedit off
histverify off
hostcomplete off
huponexit off
interactive_comments on
lastpipe off
lithist off
login_shell off
mailwarn off
no_empty_cmd_completion off
nocaseglob off
nocasematch off
nullglob off
progcomp on
promptvars on
restricted_shell off
shift_verbose off
sourcepath on
xpg_echo off
Darn, I still can't reproduce the issue :(
bash-4.2$ echo $BASH
/home/mlk/Downloads/bash-4.2.53/root/bin/bash
bash-4.2$ shopt >my.shopt
bash-4.2$ diff my.shopt klayman.shopt
32c32
< login_shell on
---
> login_shell off
bash-4.2$ ./jumpapp -L virtualbox
Matched Windows [2]
0x02800006 aquilla 17698 0 VirtualBox: Oracle VM VirtualBox Manager
0x02000002 aquilla 17807 0 VirtualBox: Test [Running] - Oracle VM VirtualBox
(Running on a Fedora 19 box)
I'm out of ideas to try, unfortunately. Feel free to leave the issue open if you want. Maybe someone else has the same problem.
Got it ) The problem is in the seamless mode. Though I see absolutely no difference in wmctrl -lpx
output.
Oh, seamless mode. I wasn't thinking about that. I have an idea what it might be. I'll investigate more later.
I think I figured it out. I just pushed jumpapp version 0.7, which should be able to match VirtualBox windows in seamless mode.
One quirk of this change is that jumpapp will now match VirtualBox's global "toolbar", which makes it seem like jumpapp did nothing even though it actuall did. That's probably not what we want, but I'm not yet sure the best way to handle it.
Thank you very much for your effort! Now switching works fine.