VirtualBox

Changeset 84741 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jun 9, 2020 3:30:17 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138534
Message:

FE/Qt. Sending _XWAYLAND_MAY_GRAB_KEYBOARD property to enable XWayland to grab keybord. Thanks to Hans de Goede

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r84336 r84741  
    22062206}
    22072207
     2208/* static */
     2209void UICommon::setXwaylandMayGrabKeyboardFlag(QWidget *pWidget)
     2210{
     2211    XXSendClientMessage(QX11Info::display(), pWidget->window()->winId(),
     2212                        "_XWAYLAND_MAY_GRAB_KEYBOARD", 1);
     2213}
    22082214#endif /* VBOX_WS_X11 */
    22092215
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h

    r83858 r84741  
    430430        /** Assigns WM_CLASS property for passed @a pWidget. */
    431431        static void setWMClass(QWidget *pWidget, const QString &strNameString, const QString &strClassString);
     432        /** Tell the WM we are well behaved wrt Xwayland keyboard-grabs. This will
     433          * make the WM turn our grab into a Wayland shortcut inhibition request,
     434          * so that e.g. alt+tab will get send to the VM instead of moving the
     435          * focus away from the VM. */
     436        static void setXwaylandMayGrabKeyboardFlag(QWidget *pWidget);
    432437#endif /* VBOX_WS_X11 */
    433438
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r82968 r84741  
    136136    /* Assign WM_CLASS property: */
    137137    UICommon::setWMClass(this, strWindowName, strWindowClass);
     138    /* Tell the WM we are well behaved wrt Xwayland keyboard-grabs: */
     139    UICommon::setXwaylandMayGrabKeyboardFlag(this);
    138140#endif
    139141}
Note: See TracChangeset for help on using the changeset viewer.

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