VirtualBox

Opened 8 years ago

Closed 7 years ago

#16046 closed defect (fixed)

VirtualBox guests interfering with proper function of fbpanel, xfce4-panel, lxpanel on host -> should be fixed in releases higher than 5.1.6/ revision 111167

Reported by: Will B Owned by:
Component: GUI Version: VirtualBox 5.1.6
Keywords: right-click, fbpanel, lxpanel, xfce4-panel Cc:
Guest type: all Host type: other

Description

fbpanel, lxpanel, xfce4-panel and possibly others have problems with right-clicking their task manager buttons after (any) virtual machine is started from the VirtualBox Manager.

Previous versions of VirtualBox (4.x.x and 5.0.x) did not have this problem.

This happens on Linux (Debian, Void) and FreeBSD 10.3 hosts.

How to reproduce this issue:

  • Whole screen flashes or blinks momentarily before Manager appears
  • Double-click virtual machine in Manager to start it
  • After virtual machine starts, right-click on the virtual machine's task manager button on the host in fbpanel, lxpanel or xfce4-panel and the context menu does not pop up.
  • Normal click another task bar button, then right-clicking works temporarily
  • Exit (all) virtual machine(s)
  • Right-clicking of task manager buttons works again in fbpanel, lxpanel and xfce4-panel.

This problem does not seem to happen when only the VirtualBox Manager is running.

VirtualBox version: 5.1.6 r110634 - (Qt5.6.1)

Attachments (3)

VBox.log (119.5 KB ) - added by Will B 8 years ago.
VBox.log of example guest
VBoxSVC.log (8.6 KB ) - added by Will B 8 years ago.
VBoxSVC.log
selectorwindow.log (809 bytes ) - added by Will B 8 years ago.
selectorwindow.log

Download all attachments as: .zip

Change History (17)

by Will B, 8 years ago

Attachment: VBox.log added

VBox.log of example guest

by Will B, 8 years ago

Attachment: VBoxSVC.log added

VBoxSVC.log

by Will B, 8 years ago

Attachment: selectorwindow.log added

selectorwindow.log

comment:1 by Michael Thayer, 8 years ago

It probably does not happen when the virtual machine is not in focus, or if you release keyboard capturing (press the host key once while the machine is active).

comment:2 by Will B, 8 years ago

@michael, I just checked, and you are correct, however it happens with auto-capture of the mouse, which is not correct behavior.

This problem did not appear until the VirtualBox 5.1.x branch was released, so there's definitely something incorrect going on.

Thanks. :)

comment:3 by Michael Thayer, 8 years ago

Summary: VirtualBox guests interfering with proper function of fbpanel, xfce4-panel, lxpanel on hostVirtualBox guests interfering with proper function of fbpanel, xfce4-panel, lxpanel on host -> should be fixed in 5.1 and higher releases, revision 111167 and higher

I was mainly asking to confirm my guess about what the problem was. I was able to reproduce this with FBPanel. It is in a rather nasty area of the code (keyboard capturing doesn't lend itself to nice solutions), but fortunately the fix turned out to be rather simple. It will be available in 5.1 builds of revision 111167 or higher (I will upload test builds<1> once they are ready), but since you also work with a FreeBSD host you may want to just apply a patch directly<2>.

Please let me know if this does not fix the problem (I definitely hope it does, see above for reasons!)

<1> https://www.virtualbox.org/wiki/Testbuilds
<2>

--- src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp	(revision 111165)
+++ src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp	(revision 111166)
@@ -373,7 +373,7 @@
          if (!isItListenedView(QApplication::widgetAt(QCursor::pos())))
              xcb_grab_button_checked(QX11Info::connection(), 0, QX11Info::appRootWindow(),
                                      XCB_EVENT_MASK_BUTTON_PRESS, XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC,
-                                     XCB_NONE, XCB_NONE, XCB_BUTTON_INDEX_1, XCB_MOD_MASK_ANY);
+                                     XCB_NONE, XCB_NONE, XCB_BUTTON_INDEX_ANY, XCB_MOD_MASK_ANY);
         /* And grab the keyboard, using XCB directly, as Qt does not report failure. */
         xcb_grab_keyboard_cookie_t xcbGrabCookie = xcb_grab_keyboard(QX11Info::connection(), false, m_views[m_iKeyboardCaptureViewIndex]->winId(),
                                                                      XCB_TIME_CURRENT_TIME, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC);
@@ -382,7 +382,7 @@
         {
             /* Release the mouse button grab.
              * We do not check for failure as we do not currently implement a back-up plan. */
-            xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_1,
+            xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_ANY,
                                       QX11Info::appRootWindow(), XCB_MOD_MASK_ANY);
             /* Try again later: */
             free(pGrabReply);
@@ -484,7 +484,7 @@
         xcb_ungrab_keyboard(QX11Info::connection(), XCB_TIME_CURRENT_TIME);
         /* Release the mouse button grab.
          * We do not check for failure as we do not currently implement a back-up plan. */
-        xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_1,
+        xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_ANY,
                                   QX11Info::appRootWindow(), XCB_MOD_MASK_ANY);
 
 # endif /* QT_VERSION >= 0x050000 */
@@ -1778,7 +1778,7 @@
             {
                 /* Release the mouse button grab.
                  * We do not check for failure as we do not currently implement a back-up plan. */
-                xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_1,
+                xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_ANY,
                                           QX11Info::appRootWindow(), XCB_MOD_MASK_ANY);
 
                 break;
@@ -1790,7 +1790,7 @@
                 if (m_fIsKeyboardCaptured)
                     xcb_grab_button_checked(QX11Info::connection(), 0, QX11Info::appRootWindow(),
                                             XCB_EVENT_MASK_BUTTON_PRESS, XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC,
-                                            XCB_NONE, XCB_NONE, XCB_BUTTON_INDEX_1, XCB_MOD_MASK_ANY);
+                                            XCB_NONE, XCB_NONE, XCB_BUTTON_INDEX_ANY, XCB_MOD_MASK_ANY);
 
                 break;
             }

comment:4 by Michael Thayer, 8 years ago

Summary: VirtualBox guests interfering with proper function of fbpanel, xfce4-panel, lxpanel on host -> should be fixed in 5.1 and higher releases, revision 111167 and higherVirtualBox guests interfering with proper function of fbpanel, xfce4-panel, lxpanel on host -> should be fixed in 5.1, revision 111167 and higher releases

in reply to:  4 comment:5 by Will B, 8 years ago

Replying to michael:

Thank you for your time. I will check out the solution. :)

comment:6 by Michael Thayer, 8 years ago

Summary: VirtualBox guests interfering with proper function of fbpanel, xfce4-panel, lxpanel on host -> should be fixed in 5.1, revision 111167 and higher releasesVirtualBox guests interfering with proper function of fbpanel, xfce4-panel, lxpanel on host -> should be fixed in releases higher than 5.1.6/ revision 111167

comment:7 by Perry Harrington, 8 years ago

Just an FYI, this also FUBARs Synergy and causes a 10-20 second delay when switching screens, if a VM is not minimized. IF the VM is minimized, all of the capture stealing problems go away.

I'm using FC24 as the Host OS and FC23 as the guest OS. I've been using VirtualBox daily for the last 3 years as a member of MySQL Support.

in reply to:  7 comment:8 by Michael Thayer, 8 years ago

Replying to Perry Harrington:

Just an FYI, this also FUBARs Synergy and causes a 10-20 second delay when switching screens, if a VM is not minimized. IF the VM is minimized, all of the capture stealing problems go away.

I'm using FC24 as the Host OS and FC23 as the guest OS. I've been using VirtualBox daily for the last 3 years as a member of MySQL Support.

Sorry, by "this" do you mean the problem or the patch to solve it?

comment:9 by Perry Harrington, 8 years ago

The focus stealing bug borks Synergy. I added the FYI because this is how I first noticed the problem. Then I was trying to update NetworkManager settings yesterday and figured out that it also affected the panel. I knew that minimizing the VM would allow Synergy to switch screens properly, but I hadn't figured out if it was a bug in Vbox or Synergy at that point (all of this came at once because I upgraded to FC24).

Once I figured out that Vbox was stealing panel focus, I came here and searched the bugtracker for 'focus' and this bug popped right up.

I haven't tried the test build because it's a shell archive, and I'm only running RPMs on my main machine. I didn't want to deal with cleaning up the shar install to then install the RPM later. I downgraded to the latest 5.0 stable release RPM for FC24.

comment:10 by Michael Thayer, 8 years ago

5.1.8 is now out. I suggest that if that does not fix this issue for you then you should open a new bug report.

comment:11 by Perry Harrington, 8 years ago

FYI, upgraded to 5.1.10 again and it's still not working correctly. When you switch to another screen, Vbox guests will steal the focus.

Do you still want another bug opened? Do you have a way to test and replicate this behavior?

comment:12 by Michael Thayer, 8 years ago

Perry, I think that you are seeing a different but related issue. Could you please create a new ticket for it and add your information there? When you have done that I will remove your comments from this ticket.

Please add a host log file as requested on the new ticket page, and test whether disabling keyboard capturing makes the problem go away without minimising the machine. I suspect that it is a problem that Synergy needs to grab the keyboard, and VirtualBox grabs it too if the user requests it (you can change that in the settings). If so it may not be possible to solve this, but it might be worth asking the Synergy team too.

comment:13 by Michael Thayer, 8 years ago

And please describe the problem you are seeing in more detail, since I do not use Synergy and do not know everything it does, in particular what its screen switching does. For information, we do not "steal the focus" as such, rather, when the user has requested keyboard capture we grab the keyboard and the mouse buttons, and release both if the user clicks outside of our windows.

comment:14 by Michael Thayer, 7 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette