VirtualBox

Ignore:
Timestamp:
Dec 12, 2017 9:54:21 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
119623
Message:

Devices/Graphics, Main, FE/Qt: add plumbing for sending cursor position events.
bugref:9038: FE/Qt: better handle mouse cursor when toggling integration
The Linux and X11 graphics driver sends notification when the guest cursor
position changes. This could be used by the front-end to switch back to
pointer capturing without requiring that the guest draw the cursor, which
often results in artifacts. This change adds the necessary plumbing between
the graphics device and the user interface.

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

Legend:

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

    r69500 r70075  
    6060# include "CProgressPercentageChangedEvent.h"
    6161# include "CProgressTaskCompletedEvent.h"
     62# include "CCursorPositionChangedEvent.h"
    6263#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    6364
     
    418419            break;
    419420        }
     421        case KVBoxEventType_OnCursorPositionChanged:
     422        {
     423            CCursorPositionChangedEvent es(pEvent);
     424            emit sigCursorPositionChange(es.GetHasData(), (unsigned long)es.GetX(), (unsigned long)es.GetY());
     425            break;
     426        }
    420427
    421428        default: break;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h

    r69500 r70075  
    127127    void sigProgressTaskComplete(QString strProgressId);
    128128
     129    /** Notifies about guest requests to change the cursor position. If @a fData is not set this merely notifies that the guest supports this.  This notification must be sent after every screen configuration change. */
     130    void sigCursorPositionChange(bool fData, unsigned long X, unsigned long Y);
     131
    129132public:
    130133
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp

    r69500 r70075  
    197197        << KVBoxEventType_OnCanShowWindow
    198198        << KVBoxEventType_OnShowWindow
    199         << KVBoxEventType_OnAudioAdapterChanged;
     199        << KVBoxEventType_OnAudioAdapterChanged
     200        << KVBoxEventType_OnCursorPositionChanged;
    200201
    201202    /* Register event listener for console event source: */
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