Bugzilla – Bug 1140084
VirtualBox constantly steals focus
Last modified: 2022-01-27 10:35:15 UTC
Summary: VirtualBox VM immediately steals back focus. Reproduce: Set up and launch a VBox VM, open a text editor on the host, try to write in it. Expected behavior: Writing appears in the text editor. Actual behavior: Focus is on the VM, writing appears there, if a text field was last selected. See for a possible explanation and workaround: https://bugreports.qt.io/browse/QTBUG-76742
Strange that I had not run into this before. Please give more details. What OS is your host, and what OS is your guest? What version of VirtualBox is on the host? Are the guest extensions installed? These are not needed for most openSUSE guests.
It seems as if the problem is in Qt. That is what your reference indicates. In addition, running VB and a particular VM fails on Tumbleweed running Qt 5.13.0-1.1. Booting Leap 15.1 running Qt 5.9 works using the same version of VB and the same VM.
I have a workaround until Qt 5.13 is fixed: wget http://www.lwfinger.com/download/libQt5Gui5-5.13.0-0.x86_64.rpm sudo zypper install --force libQt5Gui5-5.13.0-0.x86_64.rpm The zypper install command will tell you that the package is unsigned. Ignore that warning. This workaround decreases focusInTimer timeout from 400 to 200 as suggested in the QTBUG reference.
I had a quick look and VBox source code and left a comment on the linked QTBUG. (In reply to Larry Finger from comment #3) > I have a workaround until Qt 5.13 is fixed: > > wget http://www.lwfinger.com/download/libQt5Gui5-5.13.0-0.x86_64.rpm > sudo zypper install --force libQt5Gui5-5.13.0-0.x86_64.rpm > > The zypper install command will tell you that the package is unsigned. > Ignore that warning. > > This workaround decreases focusInTimer timeout from 400 to 200 as suggested > in the QTBUG reference. I recommend to build that in OBS instead and not just uploading an RPM somewhere. Not only does that save time (now I need to do the same as you did) but it also makes whatever changes you did to Qt visible. While I assume that you didn't hide a "rm -rf /*" in there, it's theoretically possible... Qt with the workaround applied is building on OBS now, once it's done you can try zypper ar obs://home:Vogtinator:boo1140084/openSUSE_Tumbleweed boo1140084 zypper -v dup --from boo1140084 to get the package. Once confirmed to work I'll submit it to TW.
Thanks so much for the quick responses guys, the fix is working. And thanks for chiming in at the Qt thread.
(In reply to Oliver Beiter from comment #5) > Thanks so much for the quick responses guys, the fix is working. And thanks > for chiming in at the Qt thread. Ok, workaround submitted to TW.
This is an autogenerated message for OBS integration: This bug (1140084) was mentioned in https://build.opensuse.org/request/show/713347 Factory / libqt5-qtbase
(In reply to Oliver Beiter from comment #5) > Thanks so much for the quick responses guys, the fix is working. And thanks > for chiming in at the Qt thread. Your research that found the QTBUG was a critical step in finding the solution. Thanks for that. My only criticism would be that you did not explicitly list the host and guest OS details. If I had not been able to reproduce the problem, finding those details would have taken extra time.
My workaround: - In the guest OS window, Ctrl+Home, Input > Keyboard > Keyboard Settings, and disable "Auto Capture Keyboard". - So far it is working surprisingly seamlessly without this option, with things like Alt+Tab still getting captured in the host OS. But this took me several hours to diagnose, and "Auto Capture Keyboard" is the default option, so I consider this to be a major bug.
Dupe
*** Bug 1140550 has been marked as a duplicate of this bug. ***