Changeset 59360 in vbox
- Timestamp:
- Jan 15, 2016 12:02:21 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 105048
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp
r59359 r59360 232 232 if (m_views.contains(uScreenId)) 233 233 { 234 /* Store new keyboard-captured state value: */235 m_fIsKeyboardCaptured = true;236 237 /* Remember which screen had captured keyboard: */238 m_iKeyboardCaptureViewIndex = uScreenId;239 240 234 #if defined(Q_WS_MAC) 241 235 … … 251 245 // TODO: Is that really needed? 252 246 ::DarwinDisableGlobalHotKeys(true); 253 m_views[ m_iKeyboardCaptureViewIndex]->grabKeyboard();247 m_views[uScreenId]->grabKeyboard(); 254 248 255 249 #elif defined(Q_WS_WIN) … … 274 268 { 275 269 # if QT_VERSION >= 0x050000 276 xcb_grab_key_checked(QX11Info::connection(), 0, m_views.value( m_iKeyboardCaptureViewIndex)->viewport()->winId(), XCB_MOD_MASK_ANY, XCB_GRAB_ANY, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC);270 xcb_grab_key_checked(QX11Info::connection(), 0, m_views.value(uScreenId)->viewport()->winId(), XCB_MOD_MASK_ANY, XCB_GRAB_ANY, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC); 277 271 # else /* QT_VERSION < 0x050000 */ 278 XGrabKey(QX11Info::display(), AnyKey, AnyModifier, m_windows[ m_iKeyboardCaptureViewIndex]->winId(), False, GrabModeAsync, GrabModeAsync);272 XGrabKey(QX11Info::display(), AnyKey, AnyModifier, m_windows[uScreenId]->winId(), False, GrabModeAsync, GrabModeAsync); 279 273 # endif /* QT_VERSION < 0x050000 */ 280 274 break; … … 285 279 { 286 280 # if QT_VERSION >= 0x050000 287 xcb_grab_keyboard(QX11Info::connection(), 0, m_views.value( m_iKeyboardCaptureViewIndex)->viewport()->winId(), XCB_CURRENT_TIME, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC);281 xcb_grab_keyboard(QX11Info::connection(), 0, m_views.value(uScreenId)->viewport()->winId(), XCB_CURRENT_TIME, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC); 288 282 # else /* QT_VERSION < 0x050000 */ 289 283 /* Keyboard grabbing can fail because of some keyboard shortcut is still grabbed by window manager. … … 296 290 * for this window on the queue. This can prevent problems 297 291 * including two windows fighting to grab the keyboard. */ 298 hWindow = m_windows[ m_iKeyboardCaptureViewIndex]->winId();292 hWindow = m_windows[uScreenId]->winId(); 299 293 if (!checkForX11FocusEvents(hWindow)) 300 294 while (cTriesLeft && XGrabKeyboard(QX11Info::display(), … … 313 307 314 308 /* On other platforms we are just praying Qt method to work: */ 315 m_views[ m_iKeyboardCaptureViewIndex]->grabKeyboard();309 m_views[uScreenId]->grabKeyboard(); 316 310 317 311 #endif 312 313 /* Remember which screen had captured keyboard: */ 314 m_iKeyboardCaptureViewIndex = uScreenId; 315 316 /* Store new keyboard-captured state value: */ 317 m_fIsKeyboardCaptured = true; 318 318 319 319 /* Notify all the listeners: */ … … 331 331 if (m_views.contains(m_iKeyboardCaptureViewIndex)) 332 332 { 333 /* Store new keyboard-captured state value: */334 m_fIsKeyboardCaptured = false;335 336 333 #if defined(Q_WS_MAC) 337 334 … … 401 398 /* Forget which screen had captured keyboard: */ 402 399 m_iKeyboardCaptureViewIndex = -1; 400 401 /* Store new keyboard-captured state value: */ 402 m_fIsKeyboardCaptured = false; 403 403 404 404 /* Notify all the listeners: */
Note:
See TracChangeset
for help on using the changeset viewer.