VirtualBox

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


Ignore:
Timestamp:
Feb 11, 2009 8:56:58 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
42711
Message:

fe/qt: SetMouseCoalescingEnabled is a NSEvent class method in the Cocoa world.

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

Legend:

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

    r16698 r16699  
    40634063 *
    40644064 * Called by eventFilter() and darwinGrabKeyboardEvents().
     4065 *
    40654066 * @param   aOn     Switch it on (true) or off (false).
    40664067 */
    40674068void VBoxConsoleView::setMouseCoalescingEnabled (bool aOn)
    40684069{
     4070    /* Enable mouse event compression if we leave the VM view. This
     4071       is necessary for having smooth resizing of the VM/other
     4072       windows.
     4073       Disable mouse event compression if we enter the VM view. So
     4074       all mouse events are registered in the VM. Only do this if
     4075       the keyboard/mouse is grabbed (this is when we have a valid
     4076       event handler). */
     4077    if (aOn || mKeyboardGrabbed)
    40694078# ifdef QT_MAC_USE_COCOA
    4070     /** @todo Carbon -> Cocoa: SetMouseCoalescingEnabled() is 32-bit only. */
     4079        ::VBoxCocoaApplication_setMouseCoalescingEnabled (aOn);
    40714080# else
    4072     if (aOn)
    4073         /* Enable mouse event compression if we leave the VM view. This
    4074            is necessary for having smooth resizing of the VM/other
    4075            windows. */
    4076         ::SetMouseCoalescingEnabled (true, NULL);
    4077     else
    4078     {
    4079         /* Disable mouse event compression if we enter the VM view. So
    4080            all mouse events are registered in the VM. Only do this if
    4081            the keyboard/mouse is grabbed (this is when we have a valid
    4082            event handler). */
    4083         if (mKeyboardGrabbed)
    4084             ::SetMouseCoalescingEnabled (false, NULL);
    4085     }
     4081        ::SetMouseCoalescingEnabled (aOn, NULL);
    40864082# endif
    40874083}
  • trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxCocoaApplication.h

    r16693 r16699  
    8080
    8181/** @name The C/C++ interface.
     82 *
     83 * @remarks This is a bit illogical as both NSApplication and NSEvent stuff
     84 *          ended up here...
    8285 * @{
    8386 */
     
    8790unsigned long VBoxCocoaApplication_getEventModifierFlags(const void *pvEvent);
    8891uint32_t VBoxCocoaApplication_getEventModifierFlagsXlated(const void *pvEvent);
     92void VBoxCocoaApplication_setMouseCoalescingEnabled(bool fEnabled);
    8993const char *VBoxCocoaApplication_eventTypeName(unsigned long eEvtType);
    9094void VBoxCocoaApplication_printEvent(const char *pszPrefix, const void *pvEvent);
    91 
    92 
    9395/** @} */
    9496
  • trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxCocoaApplication.m

    r16693 r16699  
    289289
    290290    return fCarbon;
     291}
     292
     293
     294/**
     295 * Calls the + (void)setMouseCoalescingEnabled:(BOOL)flag class method.
     296 *
     297 * @param   fEnabled    Whether to enable or disable coalescing.
     298 */
     299void VBoxCocoaApplication_setMouseCoalescingEnabled(bool fEnabled)
     300{
     301    [NSEvent setMouseCoalescingEnabled:fEnabled];
    291302}
    292303
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