Changeset 53777 in vbox for trunk/src/VBox/Additions/x11/vboxvideo
- Timestamp:
- Jan 12, 2015 8:28:13 PM (10 years ago)
- Location:
- trunk/src/VBox/Additions/x11/vboxvideo
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/vboxvideo/getmode.c
r53770 r53777 29 29 #include "windowstr.h" 30 30 #include <X11/extensions/randrproto.h> 31 #include <X11/Xatom.h>32 31 33 32 #ifdef XORG_7X … … 258 257 { 259 258 VBOXPtr pVBox = VBOXGetRec(pScrn); 260 Atom atom = MakeAtom(SIZE_HINTS_PROPERTY, sizeof(SIZE_HINTS_PROPERTY) - 1, 261 FALSE); 262 PropertyPtr prop = NULL; 259 size_t cModes; 260 int32_t *paModes; 263 261 unsigned i; 264 262 … … 282 280 } 283 281 #endif 284 /* We can get called early, before the root window is created. */ 285 if (!ROOT_WINDOW(pScrn)) 282 if (vbvxGetIntegerPropery(pScrn, SIZE_HINTS_PROPERTY, &cModes, &paModes) != VINF_SUCCESS) 286 283 return; 287 if (atom != BAD_RESOURCE) 288 { 289 for (prop = wUserProps(ROOT_WINDOW(pScrn)); 290 prop != NULL && prop->propertyName != atom; prop = prop->next); 291 } 292 if (prop && prop->type == XA_INTEGER && prop->format == 32) 293 for (i = 0; i < prop->size && i < pVBox->cScreens; ++i) 284 for (i = 0; i < cModes && i < pVBox->cScreens; ++i) 285 { 286 if (paModes[i] != 0) 294 287 { 295 if (((int32_t *)prop->data)[i] != 0) 296 { 297 pVBox->pScreens[i].aPreferredSize.cx = 298 ((int32_t *)prop->data)[i] >> 16; 299 pVBox->pScreens[i].aPreferredSize.cy = 300 ((int32_t *)prop->data)[i] & 0x8fff; 301 } 288 pVBox->pScreens[i].aPreferredSize.cx = 289 paModes[i] >> 16; 290 pVBox->pScreens[i].aPreferredSize.cy = 291 paModes[i] & 0x8fff; 302 292 } 293 } 303 294 } 304 295 -
trunk/src/VBox/Additions/x11/vboxvideo/helpers.c
r53773 r53777 23 23 #include "vboxvideo.h" 24 24 #include <os.h> 25 #include <propertyst.h> 26 #include <windowstr.h> 27 #include <X11/Xatom.h> 28 #ifdef XORG_7X 29 # include <string.h> 30 #endif 25 31 26 32 void vbvxMsg(const char *pszFormat, ...) … … 47 53 return ((VBOXPtr)pScrn->driverPrivate); 48 54 } 55 56 /* TESTING: if this is broken, dynamic resizing will not work on old X servers (1.2 and older). */ 57 int vbvxGetIntegerPropery(ScrnInfoPtr pScrn, char *pszName, size_t *pcData, int32_t **ppaData) 58 { 59 Atom atom; 60 PropertyPtr prop; 61 62 /* We can get called early, before the root window is created. */ 63 if (!ROOT_WINDOW(pScrn)) 64 return VERR_NOT_FOUND; 65 atom = MakeAtom(pszName, strlen(pszName), FALSE); 66 if (atom == BAD_RESOURCE) 67 return VERR_NOT_FOUND; 68 for (prop = wUserProps(ROOT_WINDOW(pScrn)); 69 prop != NULL && prop->propertyName != atom; prop = prop->next); 70 if (prop == NULL) 71 return VERR_NOT_FOUND; 72 if (prop->type != XA_INTEGER || prop->format != 32) 73 return VERR_NOT_FOUND; 74 *pcData = prop->size; 75 *ppaData = (int32_t *)prop->data; 76 return VINF_SUCCESS; 77 } -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
r53773 r53777 239 239 extern VBOXPtr vbvxGetRec(ScrnInfoPtr pScrn); 240 240 #define VBOXGetRec vbvxGetRec /* Temporary */ 241 extern int vbvxGetIntegerPropery(ScrnInfoPtr pScrn, char *pszName, size_t *pcData, int32_t **ppaData); 241 242 242 243 /* setmode.c */
Note:
See TracChangeset
for help on using the changeset viewer.