Changeset 81040 in vbox for trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp
- Timestamp:
- Sep 27, 2019 9:45:46 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 133643
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp
r76553 r81040 46 46 const char *aPropName, unsigned long *nItems) 47 47 { 48 LogRelFlowFunc (("\n"));48 LogRelFlowFuncEnter(); 49 49 Atom propNameAtom = XInternAtom (aDpy, aPropName, 50 50 True /* only_if_exists */); … … 65 65 return NULL; 66 66 67 LogRelFlowFunc (("returning\n"));67 LogRelFlowFuncLeave(); 68 68 return propVal; 69 69 } … … 79 79 int rc = VINF_SUCCESS; 80 80 81 LogRelFlowFunc (("\n"));81 LogRelFlowFuncEnter(); 82 82 if (mHostCallback != NULL) /* Assertion */ 83 83 { 84 LogRel(("VBoxClient: ERROR: attempt to initialise seamless guest object twice!\n"));84 VBClLogError("Attempting to initialise seamless guest object twice!\n"); 85 85 return VERR_INTERNAL_ERROR; 86 86 } 87 87 if (!(mDisplay = XOpenDisplay(NULL))) 88 88 { 89 LogRel(("VBoxClient: seamless guest object failed to acquire a connection to the display.\n"));89 VBClLogError("Seamless guest object failed to acquire a connection to the display\n"); 90 90 return VERR_ACCESS_DENIED; 91 91 } … … 93 93 mEnabled = false; 94 94 unmonitorClientList(); 95 LogRelFlowFunc (("returning %Rrc\n", rc));95 LogRelFlowFuncLeaveRC(rc); 96 96 return rc; 97 97 } … … 111 111 int error, event; 112 112 113 LogRelFlowFunc (("\n"));113 LogRelFlowFuncEnter(); 114 114 if (mEnabled) 115 115 return VINF_SUCCESS; … … 118 118 monitorClientList(); 119 119 rebuildWindowTree(); 120 LogRelFlowFunc (("returning %Rrc\n", rc));120 LogRelFlowFuncLeaveRC(rc); 121 121 return rc; 122 122 } … … 126 126 void SeamlessX11::stop(void) 127 127 { 128 LogRelFlowFunc (("\n"));128 LogRelFlowFuncEnter(); 129 129 if (!mEnabled) 130 130 return; … … 132 132 unmonitorClientList(); 133 133 freeWindowTree(); 134 LogRelFlowFunc (("returning\n"));134 LogRelFlowFuncLeave(); 135 135 } 136 136 137 137 void SeamlessX11::monitorClientList(void) 138 138 { 139 LogRelFlowFunc (("called\n"));139 LogRelFlowFuncEnter(); 140 140 XSelectInput(mDisplay, DefaultRootWindow(mDisplay), PropertyChangeMask | SubstructureNotifyMask); 141 141 } … … 143 143 void SeamlessX11::unmonitorClientList(void) 144 144 { 145 LogRelFlowFunc (("called\n"));145 LogRelFlowFuncEnter(); 146 146 XSelectInput(mDisplay, DefaultRootWindow(mDisplay), PropertyChangeMask); 147 147 } … … 153 153 void SeamlessX11::rebuildWindowTree(void) 154 154 { 155 LogRelFlowFunc (("called\n"));155 LogRelFlowFuncEnter(); 156 156 freeWindowTree(); 157 157 addClients(DefaultRootWindow(mDisplay)); … … 177 177 unsigned cChildren; 178 178 179 LogRelFlowFunc (("\n"));179 LogRelFlowFuncEnter(); 180 180 if (!XQueryTree(mDisplay, hRoot, &hRealRoot, &hParent, &phChildrenRaw, &cChildren)) 181 181 return; … … 184 184 addClientWindow(phChildren[i]); 185 185 XFree(phChildrenRaw); 186 LogRelFlowFunc (("returning\n"));186 LogRelFlowFuncLeave(); 187 187 } 188 188 … … 190 190 void SeamlessX11::addClientWindow(const Window hWin) 191 191 { 192 LogRelFlowFunc (("\n"));192 LogRelFlowFuncEnter(); 193 193 XWindowAttributes winAttrib; 194 194 bool fAddWin = true; … … 199 199 if (fAddWin && !XGetWindowAttributes(mDisplay, hWin, &winAttrib)) 200 200 { 201 LogRelFunc(("VBoxClient: Failed to get the window attributes for window %d\n", hWin));201 VBClLogError("Failed to get the window attributes for window %d\n", hWin); 202 202 fAddWin = false; 203 203 } … … 211 211 &dummyLong))) 212 212 { 213 LogRelFlowFunc(("window %lu, client window %lu has no size hints\n", 214 hWin, hClient)); 213 LogRelFlowFunc(("window %lu, client window %lu has no size hints\n", hWin, hClient)); 215 214 fAddWin = false; 216 215 } … … 244 243 pRects); 245 244 } 246 LogRelFlowFunc (("returning\n"));245 LogRelFlowFuncLeave(); 247 246 } 248 247 … … 260 259 bool rc = false; 261 260 262 LogRelFlowFunc (("\n"));261 LogRelFlowFuncEnter(); 263 262 windowTypeRaw = XXGetProperty(mDisplay, hWin, XA_ATOM, WM_TYPE_PROP, &ulCount); 264 263 if (windowTypeRaw != NULL) … … 290 289 { 291 290 /* We use post-increment in the operation to prevent the iterator from being invalidated. */ 292 LogRelFlowFunc (("\n"));291 LogRelFlowFuncEnter(); 293 292 mGuestWindows.detachAll(VBoxGuestWinFree, mDisplay); 294 LogRelFlowFunc (("returning\n"));293 LogRelFlowFuncLeave(); 295 294 } 296 295 … … 305 304 XEvent event; 306 305 307 LogRelFlowFunc (("\n"));306 LogRelFlowFuncEnter(); 308 307 /* Start by sending information about the current window setup to the host. We do this 309 308 here because we want to send all such information from a single thread. */ … … 341 340 || event.xproperty.window != DefaultRootWindow(mDisplay)) 342 341 break; 343 LogRelFlowFunc(("_NET_CLIENT_LIST property event on root window .\n"));342 LogRelFlowFunc(("_NET_CLIENT_LIST property event on root window\n")); 344 343 rebuildWindowTree(); 345 344 break; … … 392 391 void SeamlessX11::doShapeEvent(Window hWin) 393 392 { 394 LogRelFlowFunc (("\n"));393 LogRelFlowFuncEnter(); 395 394 VBoxGuestWinInfo *pInfo = mGuestWindows.find(hWin); 396 395 if (pInfo) … … 410 409 mChanged = true; 411 410 } 412 LogRelFlowFunc (("returning\n"));411 LogRelFlowFuncLeave(); 413 412 } 414 413 … … 477 476 int SeamlessX11::updateRects(void) 478 477 { 479 LogRelFlowFunc (("\n"));478 LogRelFlowFuncEnter(); 480 479 struct RectList rects = RTVEC_INITIALIZER; 481 480 … … 492 491 mcRects = RectListSize(&rects); 493 492 mpRects = RectListDetach(&rects); 494 LogRelFlowFunc (("returning\n"));493 LogRelFlowFuncLeave(); 495 494 return VINF_SUCCESS; 496 495 } … … 506 505 Display *pDisplay = XOpenDisplay(NULL); 507 506 508 LogRelFlowFunc (("\n"));507 LogRelFlowFuncEnter(); 509 508 if (pDisplay == NULL) 510 VBCl FatalError(("Failed to open X11 display.\n"));509 VBClLogFatalError("Failed to open X11 display\n"); 511 510 /* Message contents set to zero. */ 512 511 XClientMessageEvent clientMessage = { ClientMessage, 0, 0, 0, 0, 0, 8 };
Note:
See TracChangeset
for help on using the changeset viewer.