VirtualBox

Ignore:
Timestamp:
Jun 24, 2010 10:09:25 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
63088
Message:

Additions/x11/vboxmouse: properly fix spurious mouse event notifications

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/vboxmouse/vboxmouse_15.c

    r30432 r30442  
    5555#include <errno.h>
    5656#include <fcntl.h>
     57#include <unistd.h>
    5758
    5859#include "product-generated.h"
     
    6364    uint32_t cx, cy, fFeatures;
    6465
     66    /* Read a byte from the device to acknowledge the event */
     67    char c;
     68    read(pInfo->fd, &c, 1);
    6569    /* The first test here is a workaround for an apparent bug in Xorg Server 1.5 */
    6670    if (
     
    7983        cy = (cy * screenInfo.screens[0]->height) / 65535;
    8084#endif
    81         /* The X server is calling this function even if only a button was
    82          * pressed. old_x/old_y seem to be not used by the server code. */
    83         if (   (uint32_t)pInfo->old_x != cx
    84             || (uint32_t)pInfo->old_y != cy)
    85         {
    86             /* send absolute movement */
    87             xf86PostMotionEvent(pInfo->dev, 1, 0, 2, cx, cy);
    88             pInfo->old_x = cx;
    89             pInfo->old_y = cy;
    90         }
     85        /* send absolute movement */
     86        xf86PostMotionEvent(pInfo->dev, 1, 0, 2, cx, cy);
    9187    }
    9288}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette