Changeset 8476 in vbox for trunk/src/VBox/Additions/x11/xclient
- Timestamp:
- Apr 29, 2008 4:46:04 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 30345
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/xclient/displaychange-x11.cpp
r8155 r8476 66 66 67 67 /** 68 * Display change request monitor thread function 68 * Display change request monitor thread function. 69 * Before entering the loop, we re-read the last request 70 * received, and if the first one received inside the 71 * loop is identical we ignore it, because it is probably 72 * stale. 69 73 */ 70 74 int VBoxGuestDisplayChangeThreadX11::threadFunction(VBoxGuestThread *pThread) … … 72 76 mThread = pThread; 73 77 LogFlowThisFunc(("\n")); 78 uint32_t cx0 = 0, cy0 = 0, cBits0 = 0, iDisplay0 = 0; 79 int rc = VbglR3GetLastDisplayChangeRequest(&cx0, &cy0, &cBits0, &iDisplay0); 74 80 while (!mThread->isStopping()) 75 81 { 76 uint32_t cx , cy, cBits, iDisplay;82 uint32_t cx = 0, cy = 0, cBits = 0, iDisplay = 0; 77 83 int rc = VbglR3DisplayChangeWaitEvent(&cx, &cy, &cBits, &iDisplay); 78 /* If we are not stopping, sleep for a bit to avoid using up too 79 much CPU while retrying. */ 80 if (RT_FAILURE(rc) && !mThread->isStopping()) 81 mThread->yield(); 82 else 83 system("VBoxRandR"); 84 /* Ignore the request if it is stale */ 85 if ((cx != cx0) || (cy != cy0)) 86 { 87 /* If we are not stopping, sleep for a bit to avoid using up too 88 much CPU while retrying. */ 89 if (RT_FAILURE(rc) && !mThread->isStopping()) 90 mThread->yield(); 91 else 92 system("VBoxRandR"); 93 } 94 /* We do not want to ignore any further requests. */ 95 cx0 = 0; 96 cy0 = 0; 84 97 } 85 98 LogFlowThisFunc(("returning VINF_SUCCESS\n"));
Note:
See TracChangeset
for help on using the changeset viewer.