Changeset 83135 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Feb 21, 2020 2:28:56 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 136249
- Location:
- trunk/src/VBox/Additions/x11/VBoxClient
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp
r83048 r83135 26 26 #include <VBox/log.h> 27 27 28 #include "seamless-x11.h" 29 #include "VBoxClient.h" 30 28 31 #include <X11/Xatom.h> 29 32 #include <X11/Xmu/WinUtil.h> 30 31 #include "seamless-x11.h"32 #include "VBoxClient.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 }*/109 92 mHostCallback = pHostCallback; 110 93 mEnabled = false; … … 162 145 LogRelFlowFuncEnter(); 163 146 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 }183 147 } 184 148 … … 341 305 342 306 LogRelFlowFuncEnter(); 343 307 /* Start by sending information about the current window setup to the host. We do this 308 here because we want to send all such information from a single thread. */ 309 if (mChanged && mEnabled) 310 { 311 updateRects(); 312 mHostCallback(mpRects, mcRects); 313 } 314 mChanged = false; 344 315 /* We execute this even when seamless is disabled, as it also waits for 345 316 * enable and disable notification. */ 346 317 XNextEvent(mDisplay, &event); 347 monitorRandREvents(&event);348 /* Start by sending information about the current window setup to the host. We do this349 here because we want to send all such information from a single thread. */350 if (mChanged && mEnabled)351 {352 updateRects();353 mHostCallback(mpRects, mcRects);354 }355 mChanged = false;356 318 if (!mEnabled) 357 319 return; -
trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.h
r83045 r83135 31 31 #include <X11/Xlib.h> 32 32 #include <X11/Xutil.h> 33 #include <X11/Xlibint.h>34 33 #include <X11/extensions/shape.h> 35 #include <X11/extensions/Xrandr.h>36 34 37 35 #define WM_TYPE_PROP "_NET_WM_WINDOW_TYPE" … … 40 38 /* This is defined wrong in my X11 header files! */ 41 39 #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 RRScreenChangeNotifyMask47 #define RRScreenChangeNotifyMask (1L << 0)48 #endif49 /* V1.2 additions */50 #ifndef RRCrtcChangeNotifyMask51 #define RRCrtcChangeNotifyMask (1L << 1)52 #endif53 #ifndef RROutputChangeNotifyMask54 #define RROutputChangeNotifyMask (1L << 2)55 #endif56 57 #ifndef RROutputPropertyNotifyMask58 #define RROutputPropertyNotifyMask (1L << 3)59 #endif60 61 /* V1.4 additions */62 #ifndef RRProviderChangeNotifyMask63 #define RRProviderChangeNotifyMask (1L << 4)64 #endif65 66 #ifndef RRProviderPropertyNotifyMask67 #define RRProviderPropertyNotifyMask (1L << 5)68 #endif69 70 #ifndef RRResourceChangeNotifyMask71 #define RRResourceChangeNotifyMask (1L << 6)72 #endif73 74 #ifndef RRScreenChangeNotify75 /* Event codes */76 #define RRScreenChangeNotify 077 #endif78 #ifndef RRNotify79 /* V1.2 additions */80 #define RRNotify 181 #endif82 40 83 41 /** … … 232 190 /** Have there been changes since the last time we sent a notification? */ 233 191 bool mChanged; 234 /** Event mask we use to select randr related events. */235 int mRandRMask;236 int mRandREventBase;237 int mRandRErrorBase;238 bool mRandRAvailable;239 192 240 193 // Private methods … … 251 204 void monitorClientList(void); 252 205 void unmonitorClientList(void); 253 void monitorRandREvents(XEvent *pEvent);254 206 void rebuildWindowTree(void); 255 207 void addClients(const Window hRoot);
Note:
See TracChangeset
for help on using the changeset viewer.