Changeset 50981 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Apr 7, 2014 7:15:37 AM (11 years ago)
- Location:
- trunk/src/VBox/Additions/x11/vboxvideo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/vboxvideo/undefined
r50979 r50981 1 ChangeWindowProperty 1 2 DRI2CloseScreen 2 3 DRI2ScreenInit … … 19 20 ShadowFBInit2 20 21 VErrorF 22 WindowTable 21 23 XNFcalloc 22 24 XNFstrdup … … 166 168 xf86PrintDepthBpp 167 169 xf86PrintModes 170 xf86RegisterRootWindowProperty 168 171 xf86SaveScreen 169 172 xf86ScreenToScrn -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
r50979 r50981 66 66 #endif 67 67 68 /* This was accepted upstream in X.Org Server 1.16 which bumped the video 69 * driver ABI to 17. */ 70 #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 17 71 # define SET_HAVE_VT_PROPERTY 72 #endif 73 68 74 #ifndef PCIACCESS 69 75 /* Drivers for PCI hardware need this */ … … 101 107 # include "xf86Crtc.h" 102 108 # include "xf86Modes.h" 103 # include <X11/Xatom.h> 104 #endif 109 #endif 110 111 /* For setting the root window property. */ 112 #include <X11/Xatom.h> 113 #include "property.h" 105 114 106 115 #ifdef VBOX_DRI … … 979 988 } 980 989 990 #ifdef SET_HAVE_VT_PROPERTY 991 # define HAS_VT_ATOM_NAME "XFree86_has_VT" 992 /* The memory storing the initial value of the XFree86_has_VT root window 993 * property. This has to remain available until server start-up, so we just 994 * use a global. */ 995 static CARD32 HasVTValue = 1; 996 997 /** Initialise a flag property on the root window to say whether the server VT 998 * is currently the active one as some clients need to know this. */ 999 static void initialiseHasVTProperty(ScrnInfoPtr pScrn) 1000 { 1001 Atom HasVTAtom = -1; 1002 CARD32 *HasVT = &HasVTValue; 1003 HasVTAtom = MakeAtom(HAS_VT_ATOM_NAME, sizeof(HAS_VT_ATOM_NAME) - 1, TRUE); 1004 if (!xf86RegisterRootWindowProperty(pScrn->scrnIndex, HasVTAtom, XA_INTEGER, 1005 32, 1, HasVT)) 1006 xf86DrvMsg(pScrn->scrnIndex, X_WARNING, 1007 "Failed to register VT property\n"); 1008 } 1009 1010 /** Helper to work round different ways of getting the root window in different 1011 * server versions. */ 1012 #if defined(XORG_VERSION_CURRENT) && XORG_VERSION_CURRENT < 700000000 \ 1013 && XORG_VERSION_CURRENT >= 100900000 1014 # define ROOT_WINDOW(pScrn) xf86ScrnToScreen(pScrn)->root 1015 #else 1016 # define ROOT_WINDOW(pScrn) WindowTable[xf86ScrnToScreen(pScrn)->myNum] 1017 #endif 1018 1019 /** Update a flag property on the root window to say whether the server VT 1020 * is currently the active one as some clients need to know this. */ 1021 static void updateHasVTProperty(ScrnInfoPtr pScrn, Bool hasVT) 1022 { 1023 Atom property_name; 1024 int32_t value = hasVT ? 1 : 0; 1025 int i; 1026 1027 property_name = MakeAtom(HAS_VT_ATOM_NAME, sizeof(HAS_VT_ATOM_NAME) - 1, 1028 FALSE); 1029 if (property_name == BAD_RESOURCE) 1030 FatalError("Failed to retrieve \"HAS_VT\" atom\n"); 1031 ChangeWindowProperty(ROOT_WINDOW(pScrn), property_name, XA_INTEGER, 32, 1032 PropModeReplace, 1, &value, TRUE); 1033 } 1034 #endif /* SET_HAVE_VT_PROPERTY */ 1035 981 1036 /* 982 1037 * QUOTE from the XFree86 DESIGN document: … … 1178 1233 pVBox->useDRI = VBOXDRIFinishScreenInit(pScreen); 1179 1234 #endif 1235 1236 #ifdef SET_HAVE_VT_PROPERTY 1237 initialiseHasVTProperty(pScrn); 1238 #endif 1239 1180 1240 return (TRUE); 1181 1241 } … … 1209 1269 return FALSE; 1210 1270 #endif 1271 #ifdef SET_HAVE_VT_PROPERTY 1272 updateHasVTProperty(pScrn, TRUE); 1273 #endif 1211 1274 return TRUE; 1212 1275 } … … 1230 1293 #endif 1231 1294 VBOXRestoreMode(pScrn); 1295 #ifdef SET_HAVE_VT_PROPERTY 1296 updateHasVTProperty(pScrn, FALSE); 1297 #endif 1232 1298 TRACE_EXIT(); 1233 1299 }
Note:
See TracChangeset
for help on using the changeset viewer.