Changeset 83045 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Feb 11, 2020 12:31:53 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 136075
- Location:
- trunk/src/VBox/Additions/x11/VBoxClient
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/display-svga-x11.cpp
r83039 r83045 54 54 #define VMW_MAX_HEADS 32 55 55 56 /* VMWare X.Org driver control parts definitions. */ 57 58 #include <X11/Xlibint.h> 59 #include <X11/extensions/Xrandr.h> 56 #include "seamless-x11.h" 60 57 61 58 #ifdef RT_OS_LINUX -
trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp
r82968 r83045 26 26 #include <VBox/log.h> 27 27 28 #include <X11/Xatom.h> 29 #include <X11/Xmu/WinUtil.h> 30 28 31 #include "seamless-x11.h" 29 32 #include "VBoxClient.h" 30 31 #include <X11/Xatom.h>32 #include <X11/Xmu/WinUtil.h>33 33 34 34 #include <limits.h> … … 90 90 return VERR_ACCESS_DENIED; 91 91 } 92 93 mRandRMask = 0; 94 mRandRAvailable = false; 95 if (XRRQueryExtension(mDisplay, &mRandREventBase, &mRandRErrorBase)) 96 { 97 int iRandRMajor = 0; 98 int iRandRMinor = 0; 99 if (XRRQueryVersion(mDisplay, &iRandRMajor, &iRandRMinor)) 100 { 101 mRandRAvailable = true; 102 mRandRMask = RRScreenChangeNotifyMask; 103 if (iRandRMinor >= 2) 104 mRandRMask |= RRCrtcChangeNotifyMask | 105 RROutputChangeNotifyMask | 106 RROutputPropertyNotifyMask; 107 } 108 } 92 109 mHostCallback = pHostCallback; 93 110 mEnabled = false; … … 145 162 LogRelFlowFuncEnter(); 146 163 XSelectInput(mDisplay, DefaultRootWindow(mDisplay), PropertyChangeMask); 164 } 165 166 void SeamlessX11::monitorRandREvents(XEvent *pEvent) 167 { 168 if (!pEvent) 169 return; 170 int eventTypeOffset = pEvent->type - mRandREventBase; 171 switch (eventTypeOffset) 172 { 173 case RRScreenChangeNotify: 174 VBClLogError("RRScreenChangeNotify\n"); 175 break; 176 case RRNotify: 177 VBClLogError("RRNotify\n"); 178 break; 179 default: 180 VBClLogError("Unknown RR event\n"); 181 break; 182 } 147 183 } 148 184 … … 305 341 306 342 LogRelFlowFuncEnter(); 343 344 /* We execute this even when seamless is disabled, as it also waits for 345 * enable and disable notification. */ 346 XNextEvent(mDisplay, &event); 347 monitorRandREvents(&event); 307 348 /* Start by sending information about the current window setup to the host. We do this 308 349 here because we want to send all such information from a single thread. */ … … 313 354 } 314 355 mChanged = false; 315 /* We execute this even when seamless is disabled, as it also waits for316 * enable and disable notification. */317 XNextEvent(mDisplay, &event);318 356 if (!mEnabled) 319 357 return; -
trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.h
r82968 r83045 31 31 #include <X11/Xlib.h> 32 32 #include <X11/Xutil.h> 33 #include <X11/Xlibint.h> 33 34 #include <X11/extensions/shape.h> 35 #include <X11/extensions/Xrandr.h> 34 36 35 37 #define WM_TYPE_PROP "_NET_WM_WINDOW_TYPE" … … 38 40 /* This is defined wrong in my X11 header files! */ 39 41 #define VBoxShapeNotify 64 42 43 /** Following are stolen from randr.h Define XrandR stuff of they are not there (some ancient build box maybe). */ 44 45 /* Event selection bits */ 46 #ifndef RRScreenChangeNotifyMask 47 #define RRScreenChangeNotifyMask (1L << 0) 48 #endif 49 /* V1.2 additions */ 50 #ifndef RRCrtcChangeNotifyMask 51 #define RRCrtcChangeNotifyMask (1L << 1) 52 #endif 53 #ifndef RROutputChangeNotifyMask 54 #define RROutputChangeNotifyMask (1L << 2) 55 #endif 56 57 #ifndef RROutputPropertyNotifyMask 58 #define RROutputPropertyNotifyMask (1L << 3) 59 #endif 60 61 /* V1.4 additions */ 62 #ifndef RRProviderChangeNotifyMask 63 #define RRProviderChangeNotifyMask (1L << 4) 64 #endif 65 66 #ifndef RRProviderPropertyNotifyMask 67 #define RRProviderPropertyNotifyMask (1L << 5) 68 #endif 69 70 #ifndef RRResourceChangeNotifyMask 71 #define RRResourceChangeNotifyMask (1L << 6) 72 #endif 73 74 #ifndef RRScreenChangeNotify 75 /* Event codes */ 76 #define RRScreenChangeNotify 0 77 #endif 78 #ifndef RRNotify 79 /* V1.2 additions */ 80 #define RRNotify 1 81 #endif 40 82 41 83 /** … … 190 232 /** Have there been changes since the last time we sent a notification? */ 191 233 bool mChanged; 234 /** Event mask we use to select randr related events. */ 235 int mRandRMask; 236 int mRandREventBase; 237 int mRandRErrorBase; 238 bool mRandRAvailable; 192 239 193 240 // Private methods … … 204 251 void monitorClientList(void); 205 252 void unmonitorClientList(void); 253 void monitorRandREvents(XEvent *pEvent); 206 254 void rebuildWindowTree(void); 207 255 void addClients(const Window hRoot);
Note:
See TracChangeset
for help on using the changeset viewer.