VirtualBox

Ignore:
Timestamp:
Dec 17, 2013 2:49:31 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
91368
Message:

Mac OS X host: HID LEDs sync: avoid system.log flooding on 10.8 host.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/DarwinKeyboard.cpp

    r49935 r49955  
    12811281    IOReturn      rc = kIOReturnError;
    12821282
     1283    /* Try to resume built-in keyboard. Abort if failed in order to avoid GUI freezes. */
     1284    int rc1 = SUPR3ResumeBuiltinKeyboard();
     1285    if (RT_FAILURE(rc1))
     1286        return rc1;
     1287
    12831288    valueRef = IOHIDValueCreateWithIntegerValue(kCFAllocatorDefault, element, 0, (fEnabled) ? 1 : 0);
    12841289    if (valueRef)
     
    13021307    IOReturn      rc;
    13031308    CFIndex       integerValue;
     1309
     1310    /* Try to resume built-in keyboard. Abort if failed in order to avoid GUI freezes. */
     1311    int rc1 = SUPR3ResumeBuiltinKeyboard();
     1312    if (RT_FAILURE(rc1))
     1313        return rc1;
    13041314
    13051315    rc = IOHIDDeviceGetValue(hidDevice, element, &valueRef);
     
    13321342    int        rc2 = 0;
    13331343
    1334     /* Try to resume built-in keyboard. Abort if failed in order to avoid GUI freezes. */
    1335     int rc1 = SUPR3ResumeBuiltinKeyboard();
    1336     if (RT_FAILURE(rc1))
    1337         return rc1;
    1338 
    13391344    matchingElementsArrayRef = IOHIDDeviceCopyMatchingElements(hidDevice, elementMatchingDict, kIOHIDOptionsTypeNone);
    13401345    if (matchingElementsArrayRef)
     
    13821387    int        rc2 = 0;
    13831388
    1384     /* Try to resume built-in keyboard. Abort if failed in order to avoid GUI freezes. */
    1385     int rc1 = SUPR3ResumeBuiltinKeyboard();
    1386     if (RT_FAILURE(rc1))
    1387         return rc1;
    1388 
    13891389    matchingElementsArrayRef = IOHIDDeviceCopyMatchingElements(hidDevice, elementMatchingDict, kIOHIDOptionsTypeNone);
    13901390    if (matchingElementsArrayRef)
     
    18491849        VBoxKbdState_t *pKbd = (VBoxKbdState_t *)CFArrayGetValueAtIndex(pHidState->pDeviceCollection, i);
    18501850        if (pKbd && pKbd->idLocation == idLocation)
     1851        {
     1852            LogRel2(("Lookup USB HID Device by location ID 0x%X: found match\n", idLocation));
    18511853            return pKbd;
    1852     }
     1854        }
     1855    }
     1856
     1857    LogRel2(("Lookup USB HID Device by location ID 0x%X: no matches found:\n", idLocation));
    18531858
    18541859    return NULL;
     
    18831888                VBoxKbdState_t *pKbd = darwinUsbHidQueryKbdByLocationId((uint32_t)idLocation, pHidState);
    18841889
    1885                 rc = IOServiceAddInterestNotification(pHidState->pNotificationPrortRef, service, kIOGeneralInterest,
    1886                     darwinUsbHidGeneralInterestCb, pKbd, &pHidState->pUsbHidGeneralInterestNotify);
    1887 
    1888                 AssertMsg(rc == 0, ("Failed to add general interest notification"));
    1889 
    1890                 LogRel2(("Found HID device at location 0x%X: class 0x%X, subclass 0x%X\n", idLocation, idDeviceClass, idDeviceSubClass));
     1890                if (pKbd)
     1891                {
     1892                    rc = IOServiceAddInterestNotification(pHidState->pNotificationPrortRef, service, kIOGeneralInterest,
     1893                        darwinUsbHidGeneralInterestCb, pKbd, &pHidState->pUsbHidGeneralInterestNotify);
     1894
     1895                    AssertMsg(rc == 0, ("Failed to add general interest notification"));
     1896
     1897                    LogRel2(("Found HID device at location 0x%X: class 0x%X, subclass 0x%X\n", idLocation, idDeviceClass, idDeviceSubClass));
     1898                }
    18911899            }
    18921900
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