VirtualBox

Ignore:
Timestamp:
Jan 25, 2010 4:38:27 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56916
Message:

Additions/x11: simplify the newer mouse driver and work around a bug in some 1.4 series X.Org servers

Location:
trunk/src/VBox/Additions/x11/vboxmouse
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/vboxmouse/undefined_15

    r25079 r26024  
    9292miPointerCurrentScreen
    9393screenInfo
     94InitPointerDeviceStruct
  • trunk/src/VBox/Additions/x11/vboxmouse/vboxmouse_15.c

    r25456 r26024  
    7777        /* Bug in the 1.4 X server series - conversion_proc was no longer
    7878         * called, but the server didn't yet do the conversion itself. */
    79         cx = xf86ScaleAxis(cx, 0, screenInfo.screens[0]->width, 0, 65536);
    80         cy = xf86ScaleAxis(cy, 0, screenInfo.screens[0]->height, 0, 65536);
     79        cx = (cx * screenInfo.screens[0]->width) / 65535;
     80        cy = (cy * screenInfo.screens[0]->height) / 65535;
    8181#endif
    8282        /* send absolute movement */
     
    9696    Atom axis_labels[2] = { 0, 0 };
    9797    Atom button_labels[2] = { 0, 0 };
    98     InputInfoPtr pInfo;
    99 
    100     pInfo = device->public.devicePrivate;
    101     if (!InitValuatorClassDeviceStruct(device, 2,
     98    if (!InitPointerDeviceStruct((DevicePtr)device, map, 2,
     99#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
     100                                 button_labels,
     101#endif
    102102#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 2
    103                                        miPointerGetMotionEvents,
    104                                        miPointerGetMotionBufferSize(),
     103                                 miPointerGetMotionEvents, VBoxPtrCtrlProc,
     104                                 miPointerGetMotionBufferSize()
    105105#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
    106                                        GetMotionHistory,
    107                                        GetMotionHistorySize(),
    108 #elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 7
    109                                        GetMotionHistorySize(),
    110 #elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
    111                                        axis_labels,
    112                                        GetMotionHistorySize(),
     106                                 GetMotionHistory, VBoxPtrCtrlProc,
     107                                 GetMotionHistorySize(), 2 /* Number of axes */
     108
     109#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
     110                                 VBoxPtrCtrlProc, GetMotionHistorySize(),
     111                                                                 2 /* Number of axes */
    113112#else
    114113# error Unsupported version of X.Org
    115114#endif
    116                                        Absolute))
    117         return !Success;
    118 
    119     /* Pretend we have buttons so the server accepts us as a pointing device. */
    120     if (!InitButtonClassDeviceStruct(device, 2, /* number of buttons */
    121115#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
    122                                      button_labels,
    123 #endif
    124                                      map))
    125         return !Success;
    126     if (!InitPtrFeedbackClassDeviceStruct(device, VBoxPtrCtrlProc))
     116                                 , axis_labels
     117#endif
     118                                 ))
    127119        return !Success;
    128120
     
    148140    xf86InitValuatorDefaults(device, 0);
    149141    xf86InitValuatorDefaults(device, 1);
    150     xf86MotionHistoryAllocate(pInfo);
     142    xf86MotionHistoryAllocate(device->public.devicePrivate);
    151143
    152144    return Success;
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