~ubuntu-branches/ubuntu/trusty/virtualbox-ose/trusty

« back to all changes in this revision

Viewing changes to src/VBox/Additions/x11/vboxmouse/VBoxUtils.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-12-18 16:44:29 UTC
  • mfrom: (0.3.3 upstream) (0.4.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091218164429-jd34ccexpv5na11a
Tags: 3.1.2-dfsg-1ubuntu1
* Merge from Debian unstable (LP: #498219), remaining changes:
  - Disable update action
    - debian/patches/u01-disable-update-action.dpatch
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
* Fixes the following bugs:
  - Kernel module fails to build with Linux >= 2.6.32 (LP: #474625)
  - X.Org drivers need to be rebuilt against X-Server 1.7 (LP: #495935)
  - The *-source packages try to build the kernel modules even though the
    kernel headers aren't available (LP: #473334)
* Replace *-source packages with transitional packages for *-dkms.
* Adapt u01-disable-update-action.dpatch and u02-lp-integration.dpatch for
  new upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 */
21
21
 
22
22
#include <iprt/assert.h>
23
 
#include <VBox/VBoxGuest.h>
 
23
#include <iprt/err.h>
 
24
#include <VBox/VMMDev.h>
 
25
#include <VBox/VBoxGuestLib.h>
24
26
#include "VBoxUtils.h"
25
27
 
26
28
#include "xf86.h"
44
46
int VBoxMouseInit(void)
45
47
{
46
48
    int rc;
 
49
    uint32_t fFeatures = 0;
47
50
    if (gDeviceOpenFailed)
48
51
        return 1;
49
52
    rc = VbglR3Init();
54
57
        return 1;
55
58
    }
56
59
 
57
 
    rc = VbglR3SetMouseStatus(VBOXGUEST_MOUSE_GUEST_CAN_ABSOLUTE /* | VBOXGUEST_MOUSE_GUEST_NEEDS_HOST_CURSOR */);
 
60
    rc = VbglR3GetMouseStatus(&fFeatures, NULL, NULL);
 
61
    if (RT_SUCCESS(rc))
 
62
        rc = VbglR3SetMouseStatus(  fFeatures
 
63
                                  | VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE);
58
64
    if (RT_FAILURE(rc))
59
65
    {
60
66
        ErrorF("Error sending mouse pointer capabilities to VMM! rc = %d (%s)\n",
87
93
    if (RT_SUCCESS(rc))
88
94
        rc = VbglR3GetMouseStatus(&fFeatures, &cx, &cy);
89
95
    if (   RT_SUCCESS(rc)
90
 
        && !(fFeatures & VBOXGUEST_MOUSE_HOST_CAN_ABSOLUTE))
 
96
        && !(fFeatures & VMMDEV_MOUSE_HOST_CAN_ABSOLUTE))
91
97
        rc = VERR_NOT_SUPPORTED;
92
98
    if (RT_SUCCESS(rc))
93
99
    {
102
108
{
103
109
    if (gDeviceOpenFailed)
104
110
        return VINF_SUCCESS;
105
 
    int rc = VbglR3SetMouseStatus(0);
 
111
    uint32_t fFeatures;
 
112
    int rc = VbglR3GetMouseStatus(&fFeatures, NULL, NULL);
 
113
    if (RT_SUCCESS(rc))
 
114
        rc = VbglR3SetMouseStatus(  fFeatures
 
115
                                  & ~VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE);
106
116
    VbglR3Term();
107
117
    return rc;
108
118
}