Changeset 7449 in vbox
- Timestamp:
- Mar 14, 2008 6:12:27 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 28887
- Location:
- trunk/src/VBox/Additions/x11/xclient
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/xclient/clipboard.cpp
r7410 r7449 19 19 * Header Files * 20 20 *******************************************************************************/ 21 #define LOG_GROUP LOG_GROUP_DEV_VMM_BACKDOOR22 21 #include <VBox/HostServices/VBoxClipboardSvc.h> 23 22 #include <VBox/log.h> … … 40 39 41 40 #include "clipboard.h" 42 43 /* #define DEBUG_CLIPBOARD */44 #if !defined(DEBUG_CLIPBOARD) && defined(LOG_TO_BACKDOOR)45 /* Disabled unnecessary debug logging in the shared clipboard when46 LOG_TO_BACKDOOR is defined (to be removed). */47 # undef LogFlow48 # define LogFlow(a) do {} while (0)49 #endif50 51 #define TRACE printf("%s: %d\n", __PRETTY_FUNCTION__, __LINE__); Log(("%s: %d\n", __PRETTY_FUNCTION__, __LINE__))52 41 53 42 /** The formats which we support in the guest. These can be deactivated in order to test specific code paths. */ -
trunk/src/VBox/Additions/x11/xclient/clipboard.h
r7264 r7449 20 20 # define __Additions_linux_clipboard_h 21 21 22 #include <VBox/log.h> 22 23 #include "thread.h" /* for VBoxGuestThread */ 23 24 … … 90 91 int init(void) 91 92 { 93 LogFlowThisFunc(("\n")); 92 94 int rc = mThreadFunction.init(); 93 95 if (RT_SUCCESS(rc)) … … 95 97 if (RT_SUCCESS(rc)) 96 98 mInit = true; 99 LogFlowThisFunc(("returning %Rrc\n", rc)); 97 100 return rc; 98 101 } … … 103 106 void uninit(unsigned cMillies = RT_INDEFINITE_WAIT) 104 107 { 108 LogFlowThisFunc(("\n")); 105 109 if (mInit) 106 110 mThread.stop(cMillies, NULL); 111 LogFlowThisFunc(("returning\n")); 107 112 } 108 113 … … 112 117 ~VBoxGuestClipboard() 113 118 { 119 LogFlowThisFunc(("\n")); 114 120 if (mInit) 115 121 try { 116 122 uninit(2000); 117 123 } catch (...) { } 124 LogFlowThisFunc(("returning\n")); 118 125 } 119 126 }; -
trunk/src/VBox/Additions/x11/xclient/displaychange-x11.cpp
r7332 r7449 16 16 */ 17 17 18 #include <VBox/log.h> 18 19 #include <VBox/VBoxGuest.h> 19 20 #include <iprt/assert.h> … … 32 33 int rc = VINF_SUCCESS, rcSystem, rcErrno; 33 34 35 LogFlowThisFunc(("\n")); 34 36 rcSystem = system("VBoxRandR --test"); 35 37 if (-1 == rcSystem) … … 47 49 if (RT_SUCCESS(rc)) 48 50 mInit = true; 51 LogFlowThisFunc(("returning %Rrc\n", rc)); 49 52 return rc; 50 53 } … … 52 55 void VBoxGuestDisplayChangeThreadX11::uninit(void) 53 56 { 57 LogFlowThisFunc(("\n")); 54 58 VbglR3CtlFilterMask(0, VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST); 55 59 mInit = false; 60 LogFlowThisFunc(("returning\n")); 56 61 } 57 62 … … 62 67 { 63 68 mThread = pThread; 69 LogFlowThisFunc(("\n")); 64 70 while (!mThread->isStopping()) 65 71 { … … 73 79 system("VBoxRandR"); 74 80 } 81 LogFlowThisFunc(("returning VINF_SUCCESS\n")); 75 82 return VINF_SUCCESS; 76 83 } … … 87 94 * yield() should give it time to get to one of places mentioned above. 88 95 */ 96 LogFlowThisFunc(("\n")); 89 97 for (int i = 0; (i < 5) && mThread->isRunning(); ++i) 90 98 { … … 92 100 mThread->yield(); 93 101 } 102 LogFlowThisFunc(("returning\n")); 94 103 } 95 104 … … 98 107 int rc = VINF_SUCCESS; 99 108 109 LogFlowThisFunc(("\n")); 100 110 if (mInit) 101 111 return VINF_SUCCESS; … … 111 121 if (RT_SUCCESS(rc)) 112 122 mInit = true; 123 LogFlowThisFunc(("returning %Rrc\n, rc")); 113 124 return rc; 114 125 } … … 116 127 void VBoxGuestDisplayChangeMonitor::uninit(unsigned cMillies /* = RT_INDEFINITE_WAIT */) 117 128 { 129 LogFlowThisFunc(("\n")); 118 130 if (mInit) 119 131 { … … 121 133 mThreadFunction.uninit(); 122 134 } 135 LogFlowThisFunc(("returning\n")); 123 136 } -
trunk/src/VBox/Additions/x11/xclient/displaychange.h
r6970 r7449 19 19 # define __Additions_client_display_change_h 20 20 21 #include <VBox/log.h> 21 22 #include <VBox/VBoxGuest.h> /* for the R3 guest library functions */ 22 23 … … 49 50 ~VBoxGuestDisplayChangeThreadX11() 50 51 { 52 LogFlowThisFunc(("\n")); 51 53 if (mInit) 52 54 { … … 57 59 catch(...) {} 58 60 } 61 LogFlowThisFunc(("returning\n")); 59 62 } 60 63 /** … … 119 122 ~VBoxGuestDisplayChangeMonitor() 120 123 { 124 LogFlowThisFunc(("\n")); 121 125 try 122 126 { … … 124 128 } 125 129 catch(...) {} 130 LogFlowThisFunc(("returning\n")); 126 131 } 127 132 }; -
trunk/src/VBox/Additions/x11/xclient/main.cpp
r7410 r7449 16 16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 17 17 */ 18 19 // #define LOG_GROUP LOG_GROUP_DEV_VMM_BACKDOOR20 18 21 19 #include <VBox/VBoxGuest.h> … … 73 71 int rcSystem, rcErrno; 74 72 73 LogFlowFunc(("\n")); 75 74 #ifdef _POSIX_SAVED_IDS 76 75 rcSystem = setuid(getuid()); … … 84 83 LogRel(("VBoxClient: failed to drop privileges, error %Rrc.\n", rc)); 85 84 } 85 LogFlowFunc(("returning %Rrc\n", rc)); 86 86 return rc; 87 87 } … … 142 142 struct sigaction sigAction; 143 143 144 LogFlowFunc(("\n")); 144 145 sigAction.sa_handler = vboxClientSignalHandler; 145 146 sigemptyset(&sigAction.sa_mask); … … 154 155 sigaction(SIGUSR1, &sigAction, NULL); 155 156 sigaction(SIGUSR2, &sigAction, NULL); 157 LogFlowFunc(("returning\n")); 156 158 } 157 159 -
trunk/src/VBox/Additions/x11/xclient/seamless-host.cpp
r6959 r7449 21 21 *****************************************************************************/ 22 22 23 #include < iprt/log.h>23 #include <VBox/log.h> 24 24 #include <iprt/err.h> 25 25 … … 34 34 int rc = VERR_NOT_SUPPORTED; 35 35 36 LogFlowThisFunc(("\n")); 36 37 if (mRunning) /* Assertion */ 37 38 { … … 63 64 Log(("VBoxClient (seamless): failed to enable seamless capability on host, rc=%Rrc\n", rc)); 64 65 } 66 LogFlowThisFunc(("returning %Rrc\n", rc)); 65 67 return rc; 66 68 } … … 69 71 void VBoxGuestSeamlessHost::stop(unsigned cMillies /* = RT_INDEFINITE_WAIT */) 70 72 { 73 LogFlowThisFunc(("returning\n")); 71 74 if (!mRunning) /* Assertion */ 72 75 { … … 78 81 VbglR3SeamlessSetCap(false); 79 82 mRunning = false; 83 LogFlowThisFunc(("returning\n")); 80 84 } 81 85 … … 89 93 VMMDevSeamlessMode newMode = VMMDev_Seamless_Disabled; 90 94 95 LogFlowThisFunc(("\n")); 91 96 int rc = VbglR3SeamlessWaitEvent(&newMode); 92 97 if (RT_SUCCESS(rc)) … … 97 102 /* A simplified seamless mode, obtained by making the host VM window borderless and 98 103 making the guest desktop transparent. */ 99 104 #ifdef DEBUG 100 105 LogRelFunc(("VMMDev_Seamless_Visible_Region request received (VBoxClient).\n")); 101 106 #endif 102 107 mState = ENABLE; 103 108 mObserver->notify(); … … 111 116 /* fall through to case VMMDev_Seamless_Disabled */ 112 117 case VMMDev_Seamless_Disabled: 113 118 #ifdef DEBUG 114 119 LogRelFunc(("VMMDev_Seamless_Disabled set (VBoxClient).\n")); 115 120 #endif 116 121 mState = DISABLE; 117 122 mObserver->notify(); … … 122 127 LogFunc(("VbglR3SeamlessWaitEvent returned %Rrc (VBoxClient)\n", rc)); 123 128 } 129 LogFlowThisFunc(("returning %Rrc\n", rc)); 124 130 return rc; 125 131 } … … 130 136 void VBoxGuestSeamlessHost::updateRects(std::auto_ptr<std::vector<RTRECT> > pRects) 131 137 { 138 LogFlowThisFunc(("\n")); 132 139 if (0 == pRects.get()) /* Assertion */ 133 140 { … … 136 143 } 137 144 VbglR3SeamlessSendRects(pRects.get()->size(), pRects.get()->empty() ? NULL : &pRects.get()->front()); 145 LogFlowThisFunc(("returning\n")); 138 146 } 139 147 … … 146 154 int VBoxGuestSeamlessHostThread::threadFunction(VBoxGuestThread *pThread) 147 155 { 156 LogFlowThisFunc(("\n")); 148 157 if (0 != mHost) 149 158 { … … 159 168 } 160 169 } 170 LogFlowThisFunc(("returning VINF_SUCCESS\n")); 161 171 return VINF_SUCCESS; 162 172 } … … 167 177 void VBoxGuestSeamlessHostThread::stop(void) 168 178 { 179 LogFlowThisFunc(("\n")); 169 180 if (0 != mHost) 170 181 { … … 181 192 } 182 193 } 194 LogFlowThisFunc(("returning\n")); 183 195 } -
trunk/src/VBox/Additions/x11/xclient/seamless-host.h
r6959 r7449 22 22 #include <vector> /* for vector */ 23 23 24 #include <VBox/log.h> 24 25 #include <VBox/VBoxGuest.h> /* for the R3 guest library functions */ 25 26 … … 121 122 int init(VBoxGuestSeamlessObserver *pObserver) 122 123 { 124 LogFlowThisFunc(("\n")); 123 125 if (mObserver != 0) /* Assertion */ 124 126 { … … 127 129 } 128 130 mObserver = pObserver; 131 LogFlowThisFunc(("returning VINF_SUCCESS\n")); 129 132 return VINF_SUCCESS; 130 133 } … … 161 164 ~VBoxGuestSeamlessHost() 162 165 { 166 LogFlowThisFunc(("\n")); 163 167 if (mRunning) /* Assertion */ 164 168 { … … 170 174 catch(...) {} 171 175 } 176 LogFlowThisFunc(("returning\n")); 172 177 } 173 178 }; -
trunk/src/VBox/Additions/x11/xclient/seamless-x11.cpp
r7446 r7449 21 21 *****************************************************************************/ 22 22 23 #include <iprt/log.h>24 23 #include <iprt/err.h> 25 24 #include <iprt/assert.h> 25 #include <VBox/log.h> 26 26 #include <VBox/VBoxGuest.h> 27 27 … … 41 41 const char *aPropName, unsigned long *nItems) 42 42 { 43 LogFlowFunc(("\n")); 43 44 Atom propNameAtom = XInternAtom (aDpy, aPropName, 44 45 True /* only_if_exists */); … … 59 60 return NULL; 60 61 62 LogFlowFunc(("returning\n")); 61 63 return propVal; 62 64 } … … 71 73 int rc = VINF_SUCCESS; 72 74 75 LogFlowThisFunc(("\n")); 73 76 if (0 != mObserver) /* Assertion */ 74 77 { … … 82 85 } 83 86 mObserver = pObserver; 87 LogFlowThisFunc(("returning %Rrc\n", rc)); 84 88 return rc; 85 89 } … … 99 103 int error, event; 100 104 105 LogFlowThisFunc(("\n")); 101 106 mSupportsShape = XShapeQueryExtension(mDisplay, &event, &error); 102 107 mEnabled = true; 103 108 monitorClientList(); 104 109 rebuildWindowTree(); 110 LogFlowThisFunc(("returning %Rrc\n", rc)); 105 111 return rc; 106 112 } … … 110 116 void VBoxGuestSeamlessX11::stop(void) 111 117 { 118 LogFlowThisFunc(("\n")); 112 119 mEnabled = false; 113 120 unmonitorClientList(); 114 121 freeWindowTree(); 122 LogFlowThisFunc(("returning\n")); 115 123 } 116 124 117 125 void VBoxGuestSeamlessX11::monitorClientList(void) 118 126 { 127 LogFlowThisFunc(("called\n")); 119 128 XSelectInput(mDisplay, DefaultRootWindow(mDisplay.get()), SubstructureNotifyMask); 120 129 } … … 122 131 void VBoxGuestSeamlessX11::unmonitorClientList(void) 123 132 { 133 LogFlowThisFunc(("called\n")); 124 134 XSelectInput(mDisplay, DefaultRootWindow(mDisplay.get()), 0); 125 135 } … … 131 141 void VBoxGuestSeamlessX11::rebuildWindowTree(void) 132 142 { 143 LogFlowThisFunc(("called\n")); 133 144 freeWindowTree(); 134 145 addClients(DefaultRootWindow(mDisplay.get())); … … 153 164 unsigned cChildren; 154 165 166 LogFlowThisFunc(("\n")); 155 167 if (!XQueryTree(mDisplay.get(), hRoot, &hRealRoot, &hParent, &phChildrenRaw, &cChildren)) 156 168 return; … … 158 170 for (unsigned i = 0; i < cChildren; ++i) 159 171 addClientWindow(phChildren.get()[i]); 172 LogFlowThisFunc(("returning\n")); 160 173 } 161 174 … … 163 176 void VBoxGuestSeamlessX11::addClientWindow(const Window hWin) 164 177 { 178 LogFlowThisFunc(("\n")); 165 179 XWindowAttributes winAttrib; 166 180 bool fAddWin = true; … … 208 222 winAttrib.width, winAttrib.height, cRects, rects); 209 223 } 224 LogFlowThisFunc(("returning\n")); 210 225 } 211 226 … … 223 238 bool rc = false; 224 239 240 LogFlowThisFunc(("\n")); 225 241 windowTypeRaw = XXGetProperty(mDisplay, hWin, XA_ATOM, WM_TYPE_PROP, &ulCount); 226 242 if (windowTypeRaw != NULL) … … 231 247 rc = true; 232 248 } 249 LogFlowThisFunc(("returning %s\n", rc ? "true" : "false")); 233 250 return rc; 234 251 } … … 241 258 { 242 259 /* We use post-increment in the operation to prevent the iterator from being invalidated. */ 260 LogFlowThisFunc(("\n")); 243 261 for (VBoxGuestWindowList::iterator it = mGuestWindows.begin(); it != mGuestWindows.end(); 244 262 mGuestWindows.removeWindow(it++)) … … 246 264 XShapeSelectInput(mDisplay, it->first, 0); 247 265 } 266 LogFlowThisFunc(("returning\n")); 248 267 } 249 268 … … 258 277 XEvent event; 259 278 279 LogFlowThisFunc(("\n")); 260 280 /* Start by sending information about the current window setup to the host. We do this 261 281 here because we want to send all such information from a single thread. */ … … 279 299 break; 280 300 } 301 LogFlowThisFunc(("returning\n")); 281 302 } 282 303 … … 288 309 void VBoxGuestSeamlessX11::doConfigureEvent(const XConfigureEvent *event) 289 310 { 311 LogFlowThisFunc(("\n")); 290 312 VBoxGuestWindowList::iterator iter; 291 313 … … 303 325 } 304 326 } 327 LogFlowThisFunc(("returning\n")); 305 328 } 306 329 … … 312 335 void VBoxGuestSeamlessX11::doMapEvent(const XMapEvent *event) 313 336 { 337 LogFlowThisFunc(("\n")); 314 338 VBoxGuestWindowList::iterator iter; 315 339 … … 319 343 addClientWindow(event->window); 320 344 } 345 LogFlowThisFunc(("returning\n")); 321 346 } 322 347 … … 329 354 void VBoxGuestSeamlessX11::doShapeEvent(const XShapeEvent *event) 330 355 { 356 LogFlowThisFunc(("\n")); 331 357 VBoxGuestWindowList::iterator iter; 332 358 … … 342 368 iter->second->mapRects = rects; 343 369 } 370 LogFlowThisFunc(("returning\n")); 344 371 } 345 372 … … 351 378 void VBoxGuestSeamlessX11::doUnmapEvent(const XUnmapEvent *event) 352 379 { 380 LogFlowThisFunc(("\n")); 353 381 VBoxGuestWindowList::iterator iter; 354 382 … … 358 386 mGuestWindows.removeWindow(iter); 359 387 } 388 LogFlowThisFunc(("returning\n")); 360 389 } 361 390 … … 365 394 std::auto_ptr<std::vector<RTRECT> > VBoxGuestSeamlessX11::getRects(void) 366 395 { 396 LogFlowThisFunc(("\n")); 367 397 unsigned cRects = 0; 368 398 std::auto_ptr<std::vector<RTRECT> > apRects(new std::vector<RTRECT>); … … 408 438 } 409 439 mcRects = cRects; 440 LogFlowThisFunc(("returning\n")); 410 441 return apRects; 411 442 } … … 418 449 bool VBoxGuestSeamlessX11::interruptEvent(void) 419 450 { 451 bool rc = false; 452 453 LogFlowThisFunc(("\n")); 420 454 /* Message contents set to zero. */ 421 455 XClientMessageEvent clientMessage = { ClientMessage, 0, 0, 0, 0, 0, 8 }; … … 425 459 { 426 460 XFlush(mDisplay); 427 return true; 428 } 429 return false; 430 } 461 rc = true; 462 } 463 LogFlowThisFunc(("returning %s\n", rc ? "true" : "false")); 464 return rc; 465 } -
trunk/src/VBox/Additions/x11/xclient/seamless-x11.h
r7106 r7449 20 20 # define __Additions_linux_seamless_x11_h 21 21 22 #include <VBox/log.h> 23 22 24 #include "seamless-guest.h" 23 25 … … 136 138 bool init(char *name = NULL) 137 139 { 140 LogFlowThisFunc(("\n")); 138 141 mDisplay = XOpenDisplay(name); 142 LogFlowThisFunc(("returning\n")); 139 143 return (mDisplay != NULL); 140 144 } … … 144 148 int close(void) 145 149 { 150 LogFlowThisFunc(("\n")); 146 151 int rc = XCloseDisplay(mDisplay); 147 152 mDisplay = NULL; 153 LogFlowThisFunc(("returning\n")); 148 154 return rc; 149 155 } … … 229 235 VBoxGuestX11Pointer<XRectangle> rects) 230 236 { 237 LogFlowThisFunc(("\n")); 231 238 VBoxGuestWinInfo *pInfo = new VBoxGuestWinInfo(isMapped, x, y, w, h, cRects, 232 239 rects); 233 240 mWindows.insert(std::pair<Window, VBoxGuestWinInfo *>(hWin, pInfo)); 241 LogFlowThisFunc(("returning\n")); 234 242 } 235 243 236 244 void removeWindow(iterator it) 237 245 { 246 LogFlowThisFunc(("called\n")); 238 247 delete it->second; 239 248 mWindows.erase(it); … … 242 251 void removeWindow(Window hWin) 243 252 { 253 LogFlowThisFunc(("called\n")); 244 254 removeWindow(find(hWin)); 245 255 } -
trunk/src/VBox/Additions/x11/xclient/seamless.h
r7264 r7449 18 18 #ifndef __Additions_xclient_seamless_h 19 19 # define __Additions_xclient_seamless_h 20 21 #include <VBox/log.h> 20 22 21 23 #include "seamless-host.h" … … 53 55 int rc = VINF_SUCCESS; 54 56 57 LogFlowThisFunc(("\n")); 55 58 rc = mGuest->start(); 56 59 if (RT_SUCCESS(rc)) … … 62 65 mGuest->stop(); 63 66 } 67 LogFlowThisFunc(("returning %Rrc\n", rc)); 64 68 return rc; 65 69 } … … 140 144 int rc = VINF_SUCCESS; 141 145 146 LogFlowThisFunc(("\n")); 142 147 if (isInitialised) /* Assertion */ 143 148 { … … 165 170 LogFunc(("returning %Rrc (VBoxClient)\n", rc)); 166 171 } 172 LogFlowThisFunc(("returning %Rrc\n", rc)); 167 173 return rc; 168 174 } … … 170 176 void uninit(unsigned cMillies = RT_INDEFINITE_WAIT) 171 177 { 178 LogFlowThisFunc(("\n")); 172 179 if (isInitialised) 173 180 { … … 177 184 isInitialised = false; 178 185 } 186 LogFlowThisFunc(("returning\n")); 179 187 } 180 188 -
trunk/src/VBox/Additions/x11/xclient/thread.cpp
r6897 r7449 16 16 */ 17 17 18 #include <VBox/log.h> 18 19 #include <iostream> /* For std::exception */ 19 20 … … 25 26 int rc = VINF_SUCCESS; 26 27 28 LogFlowThisFunc(("\n")); 27 29 if (NIL_RTTHREAD == mSelf) /* Assertion */ 28 30 { … … 44 46 } 45 47 } 48 LogFlowThisFunc(("returning %Rrc\n", rc)); 46 49 return rc; 47 50 } … … 50 53 VBoxGuestThread::~VBoxGuestThread(void) 51 54 { 55 LogFlowThisFunc(("\n")); 52 56 if (NIL_RTTHREAD != mSelf) 53 57 { … … 59 63 catch(...) {} 60 64 } 65 LogFlowThisFunc(("returning\n")); 61 66 } 62 67 … … 64 69 int VBoxGuestThread::start(void) 65 70 { 71 int rc = VINF_SUCCESS; 72 73 LogFlowThisFunc(("returning\n")); 66 74 if (NIL_RTTHREAD != mSelf) /* Assertion */ 67 75 { … … 70 78 } 71 79 mExit = false; 72 r eturnRTThreadCreate(&mSelf, threadFunction, reinterpret_cast<void *>(this),80 rc = RTThreadCreate(&mSelf, threadFunction, reinterpret_cast<void *>(this), 73 81 mStack, mType, mFlags, mName); 82 LogFlowThisFunc(("returning %Rrc\n", rc)); 83 return rc; 74 84 } 75 85 … … 84 94 { 85 95 int rc = VINF_SUCCESS; 96 97 LogFlowFunc(("\n")); 86 98 PSELF pSelf = reinterpret_cast<PSELF>(pvUser); 87 99 pSelf->mRunning = true; … … 101 113 } 102 114 pSelf->mRunning = false; 115 LogFlowFunc(("returning %Rrc\n", rc)); 103 116 return rc; 104 117 }
Note:
See TracChangeset
for help on using the changeset viewer.