Changeset 37365 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jun 7, 2011 8:31:18 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 72135
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp
r37364 r37365 483 483 * and this hack is probably not necessary anymore. So disable it for Qt >= 4.5.0. */ 484 484 case XFocusOut: 485 case XFocusIn:486 485 { 487 486 if (isSessionRunning()) … … 489 488 if (VBoxGlobal::qtRTVersion() < ((4 << 16) | (5 << 8) | 0)) 490 489 { 491 if (pEvent->type == XFocusIn) 492 { 493 #if 0 494 /* Capture keyboard by chosen view number: */ 495 captureKeyboard(uScreenId); 496 /* Reset the single-time disable capture flag: */ 497 if (isAutoCaptureDisabled()) 498 setAutoCaptureDisabled(false); 499 #endif 500 } 501 else 502 { 503 /* Release keyboard: */ 504 releaseKeyboard(); 505 /* And all pressed keys including host-one: */ 506 releaseAllPressedKeys(true); 507 } 490 /* Release keyboard: */ 491 releaseKeyboard(); 492 /* And all pressed keys including host-one: */ 493 releaseAllPressedKeys(true); 508 494 } 509 495 } … … 604 590 break; 605 591 } 606 #if 0607 case KMachineState_Running:608 {609 /* Capture the keyboard by the first focused view: */610 QList<ulong> theListOfViewIds = m_views.keys();611 for (int i = 0; i < theListOfViewIds.size(); ++i)612 {613 if (viewHasFocus(theListOfViewIds[i]))614 {615 /* Capture keyboard: */616 #ifdef Q_WS_WIN617 if (!isAutoCaptureDisabled() && autoCaptureSetGlobally() &&618 GetAncestor(m_views[theListOfViewIds[i]]->winId(), GA_ROOT) == GetForegroundWindow())619 #else /* Q_WS_WIN */620 if (!isAutoCaptureDisabled() && autoCaptureSetGlobally())621 #endif /* !Q_WS_WIN */622 captureKeyboard(theListOfViewIds[i]);623 /* Reset the single-time disable capture flag: */624 if (isAutoCaptureDisabled())625 setAutoCaptureDisabled(false);626 break;627 }628 }629 break;630 }631 #endif632 592 default: 633 593 break; … … 830 790 switch (pEvent->type()) 831 791 { 832 #if 0833 case QEvent::FocusIn:834 if (isSessionRunning())835 {836 /* Capture keyboard: */837 #ifdef Q_WS_WIN838 if (!isAutoCaptureDisabled() && autoCaptureSetGlobally() &&839 GetAncestor(pWatchedView->winId(), GA_ROOT) == GetForegroundWindow())840 #else /* Q_WS_WIN */841 if (!isAutoCaptureDisabled() && autoCaptureSetGlobally())842 #endif /* !Q_WS_WIN */843 captureKeyboard(uScreenId);844 /* Reset the single-time disable capture flag: */845 if (isAutoCaptureDisabled())846 setAutoCaptureDisabled(false);847 }848 break;849 #endif850 792 case QEvent::FocusOut: 851 793 /* Release keyboard: */
Note:
See TracChangeset
for help on using the changeset viewer.