1
0
forked from pool/virtualbox
virtualbox/fixes_focus_steal.patch
Larry Finger 9b7dcb7653 Accepting request 713743 from home:lwfinger:branches:Virtualization
- Update the patch for SLE15 to handle the changes in SP1.

- Fix Virtualbox for problem with stealing focus under Qt 5.13 bsc#1140084. File "fixes_focus_steal.patch" is added.

OBS-URL: https://build.opensuse.org/request/show/713743
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=495
2019-07-10 14:36:54 +00:00

23 lines
1.2 KiB
Diff

Index: a/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp
===================================================================
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp (revision 131843)
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp
(working copy)
@@ -269,6 +269,14 @@
* the keyboard before the target window sees the click. (GNOME Shell's hot corner has
* the same problem. At present we just let that problem be.) */
+ /* Make sure we really do still have the focus: */
+ xcb_get_input_focus_cookie_t xcbFocusCookie = xcb_get_input_focus(QX11Info::connection());
+ xcb_get_input_focus_reply_t *pFocusReply = xcb_get_input_focus_reply(QX11Info::connection(), xcbFocusCookie, 0);
+ xcb_window_t xcbFocusWindow = pFocusReply->focus;
+ free(pFocusReply);
+ if (xcbFocusWindow != m_windows[m_iKeyboardCaptureViewIndex]->winId())
+ return true;
+
/* Grab the mouse button.
* We do not check for failure as we do not currently implement a back-up plan. */
/* If any previous grab is still in process, release it. */