VirtualBox

Ignore:
Timestamp:
Nov 28, 2009 11:31:19 PM (15 years ago)
Author:
vboxsync
Message:

Additions/x11/vboxmouse: make the X.Org server 1.5 mouse driver work on X.Org server 1.3 and 1.4

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

Legend:

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

    r22694 r25079  
    8787__moddi3
    8888InitPtrFeedbackClassDeviceStruct
     89xf86ScaleAxis
     90miPointerGetMotionEvents
     91miPointerGetMotionBufferSize
     92miPointerCurrentScreen
     93screenInfo
  • trunk/src/VBox/Additions/x11/vboxmouse/vboxmouse_15.c

    r23039 r25079  
    5353#include <xf86.h>
    5454#include <xf86Xinput.h>
    55 #include <exevents.h>
    5655#include <mipointer.h>
    5756
     
    6766
    6867    /* The first test here is a workaround for an apparent bug in Xorg Server 1.5 */
    69     if (   miPointerGetScreen(pInfo->dev) != NULL
    70         && RT_SUCCESS(VbglR3GetMouseStatus(&fFeatures, &cx, &cy))
     68    if (
     69#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 2
     70           miPointerCurrentScreen() != NULL
     71#else
     72           miPointerGetScreen(pInfo->dev) != NULL
     73#endif
     74        &&  RT_SUCCESS(VbglR3GetMouseStatus(&fFeatures, &cx, &cy))
    7175        && (fFeatures & VMMDEV_MOUSE_HOST_CAN_ABSOLUTE))
    7276        /* send absolute movement */
     
    9094    pInfo = device->public.devicePrivate;
    9195    if (!InitValuatorClassDeviceStruct(device, 2,
    92 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
     96#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 2
     97                                       miPointerGetMotionEvents,
     98                                       miPointerGetMotionBufferSize(),
     99#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
    93100                                       GetMotionHistory,
     101                                       GetMotionHistorySize(),
     102#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 7
     103                                       GetMotionHistorySize(),
    94104#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
    95105                                       axis_labels,
    96 #endif
    97                                        GetMotionHistorySize(), Absolute))
     106                                       GetMotionHistorySize(),
     107#else
     108# error Unsupported version of X.Org
     109#endif
     110                                       Absolute))
    98111        return !Success;
    99112
     
    146159            return xrc;
    147160        }
    148         xf86Msg(X_CONFIG, "%s: Mouse Integration associated with screen %d\n",
    149                 pInfo->name,
    150                 xf86SetIntOption(pInfo->options, "ScreenNumber", 0));
    151161        break;
    152162
     
    204214}
    205215
     216#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 2
     217static Bool
     218VBoxConvert(InputInfoPtr pInfo, int first, int num, int v0, int v1, int v2,
     219            int v3, int v4, int v5, int *x, int *y)
     220{
     221    if (first == 0) {
     222        *x = xf86ScaleAxis(v0, 0, screenInfo.screens[0]->width, 0, 65536);
     223        *y = xf86ScaleAxis(v1, 0, screenInfo.screens[0]->height, 0, 65536);
     224        return TRUE;
     225    } else
     226        return FALSE;
     227}
     228#endif
     229
    206230static InputInfoPtr
    207231VBoxPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
     
    220244    /* Unlike evdev, we set this unconditionally, as we don't handle keyboards. */
    221245    pInfo->type_name = XI_MOUSE;
     246#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 2
     247    pInfo->conversion_proc = VBoxConvert;
     248#endif
    222249    pInfo->flags = XI86_POINTER_CAPABLE | XI86_SEND_DRAG_EVENTS |
    223250            XI86_ALWAYS_CORE;
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