Changeset 23422 in vbox for trunk/src/VBox/Additions/x11
- Timestamp:
- Sep 29, 2009 8:47:35 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 52996
- Location:
- trunk/src/VBox/Additions/x11/vboxvideo
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/vboxvideo/vboxutils_68.c
r21227 r23422 140 140 VMMDevReqMouseStatus req; 141 141 142 int vrc = vmmdevInitRequest ((VMMDevRequestHeader*)&req, VMMDevReq_GetMouseStatus); 143 if (RT_FAILURE (vrc)) 144 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, 145 "Unable to determine whether the virtual machine supports mouse pointer integration - request initialization failed with return code %d\n", rc); 146 #ifdef RT_OS_LINUX 147 if ( RT_SUCCESS(vrc) 148 && (ioctl(pVBox->vbox_fd, VBOXGUEST_IOCTL_VMMREQUEST(sizeof(req)), (void*)&req) < 0)) 149 #else 150 # error port me! 151 #endif 152 { 153 vrc = VERR_FILE_IO_ERROR; 154 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, 155 "Unable to determine whether the virtual machine supports mouse pointer integration - request system call failed: %s.\n", 156 strerror(errno)); 157 } 158 if ( RT_SUCCESS(rc) 159 && !(req.mouseFeatures & VMMDEV_MOUSE_HOST_CANNOT_HWPOINTER) 160 && (req.mouseFeatures & VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE)) 161 rc = TRUE; 142 /* We may want to force the use of a software cursor. Currently this is 143 * needed if the guest uses a large virtual resolution, as in this case 144 * the host and guest tend to disagree about the pointer location. */ 145 if (pVBox->forceSWCursor) 146 rc = FALSE; 147 else 148 { 149 int vrc = vmmdevInitRequest ((VMMDevRequestHeader*)&req, VMMDevReq_GetMouseStatus); 150 if (RT_FAILURE (vrc)) 151 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, 152 "Unable to determine whether the virtual machine supports mouse pointer integration - request initialization failed with return code %d\n", rc); 153 #ifdef RT_OS_LINUX 154 if ( RT_SUCCESS(vrc) 155 && (ioctl(pVBox->vbox_fd, VBOXGUEST_IOCTL_VMMREQUEST(sizeof(req)), (void*)&req) < 0)) 156 #else 157 # error port me! 158 #endif 159 { 160 vrc = VERR_FILE_IO_ERROR; 161 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, 162 "Unable to determine whether the virtual machine supports mouse pointer integration - request system call failed: %s.\n", 163 strerror(errno)); 164 } 165 if ( RT_SUCCESS(rc) 166 && !(req.mouseFeatures & VMMDEV_MOUSE_HOST_CANNOT_HWPOINTER) 167 && (req.mouseFeatures & VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE)) 168 rc = TRUE; 169 } 162 170 return rc; 163 171 } … … 861 869 #endif 862 870 871 /* Hide the host cursor before we initialise if we wish to use a 872 * software cursor. */ 873 if (pVBox->forceSWCursor) 874 vbox_vmm_hide_cursor(pScrn, pVBox); 863 875 rc = xf86InitCursor (pScreen, pCurs); 864 876 if (rc == TRUE) -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo_68.c
r21292 r23422 803 803 } 804 804 pVBox = VBOXGetRec(pScrn); 805 /* We force a software cursor if the guests virtual resolution is different 806 * to it's actual resolution, as in this case host and guest will disagree 807 * about the pointer position. */ 808 if ( (pScrn->virtualX - xRes >= 8) 809 || (pScrn->virtualY - pMode->VDisplay >= 8)) 810 pVBox->forceSWCursor = TRUE; 811 else 812 pVBox->forceSWCursor = FALSE; 813 805 814 pScrn->vtSema = TRUE; 806 815 /* Disable linear framebuffer mode before making changes to the resolution. */ -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo_68.h
r21227 r23422 154 154 Bool useVbva; 155 155 int viewportX, viewportY; 156 Bool forceSWCursor; 156 157 VMMDevVideoAccelFlush *reqf; 157 158 VMMDevVideoAccelEnable *reqe;
Note:
See TracChangeset
for help on using the changeset viewer.