Changeset 37173 in vbox for trunk/src/VBox/Additions
- Timestamp:
- May 21, 2011 8:45:49 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/x11/VBoxClient
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp
r36806 r37173 418 418 { 419 419 LogRelFlowFunc(("\n")); 420 VBoxGuestWinFree(mGuestWindows.removeWindow(hWin), NULL); 421 mChanged = true; 420 VBoxGuestWinInfo *pInfo = mGuestWindows.removeWindow(hWin); 421 if (pInfo) 422 { 423 VBoxGuestWinFree(pInfo, mDisplay); 424 mChanged = true; 425 } 422 426 LogRelFlowFunc(("returning\n")); 423 427 } -
trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11-auto.cpp
r36809 r37173 1 1 /** @file 2 2 * Automated test of the X11 seamless Additions code. 3 * @todo Better separate test data from implementation details! 3 4 */ 4 5 … … 67 68 Atom XInternAtom(Display *display, const char *atom_name, Bool only_if_exists) 68 69 { 70 Assert(display == TEST_DISPLAY); 69 71 if (!RTStrCmp(atom_name, WM_TYPE_PROP)) 70 72 return (Atom) ATOM_PROP; … … 95 97 unsigned char **prop_return) 96 98 { 97 Atom atomType = XInternAtom (NULL, WM_TYPE_PROP, true); 98 Atom atomTypeDesktop = XInternAtom (NULL, WM_TYPE_DESKTOP_PROP, true); 99 Assert(display == TEST_DISPLAY); 100 Atom atomType = XInternAtom (display, WM_TYPE_PROP, true); 101 Atom atomTypeDesktop = XInternAtom (display, WM_TYPE_DESKTOP_PROP, true); 99 102 /* We only handle things we expect. */ 100 103 AssertReturn((req_type == XA_ATOM) || (req_type == AnyPropertyType), … … 130 133 Bool XShapeQueryExtension (Display *dpy, int *event_basep, int *error_basep) 131 134 { 135 Assert(dpy == TEST_DISPLAY); 132 136 return true; 133 137 } … … 137 141 int XSelectInput(Display *display, Window w, long event_mask) 138 142 { 143 Assert(display == TEST_DISPLAY); 139 144 return 0; 140 145 } … … 144 149 unsigned long event_mask); 145 150 void XShapeSelectInput(Display *display, Window w, unsigned long event_mask) 146 {} 151 { 152 Assert(display == TEST_DISPLAY); 153 } 147 154 148 155 extern "C" Window XDefaultRootWindow(Display *display); 149 156 Window XDefaultRootWindow(Display *display) 150 157 { 158 Assert(display == TEST_DISPLAY); 151 159 return TEST_ROOT; 152 160 } … … 164 172 unsigned int *nchildren_return) 165 173 { 174 Assert(display == TEST_DISPLAY); 166 175 AssertReturn(w == TEST_ROOT, False); /* We support nothing else */ 167 176 AssertPtrReturn(children_return, False); … … 181 190 Window XmuClientWindow(Display *dpy, Window win) 182 191 { 192 Assert(dpy == TEST_DISPLAY); 183 193 return win; 184 194 } … … 189 199 XWindowAttributes *window_attributes_return) 190 200 { 201 Assert(display == TEST_DISPLAY); 191 202 AssertPtrReturn(window_attributes_return, 1); 192 203 for (unsigned i = 0; i < g_cSmlsWindows; ++i) … … 206 217 XSizeHints *hints_return, long *supplied_return) 207 218 { 219 Assert(display == TEST_DISPLAY); 208 220 return 1; 209 221 } … … 229 241 int *count, int *ordering) 230 242 { 243 Assert(dpy == TEST_DISPLAY); 231 244 if ((window != g_SmlsShapedWindow) || (window == 0)) 232 245 return NULL; /* Probably not correct, but works for us. */ … … 253 266 int XNextEvent(Display *display, XEvent *event_return) 254 267 { 268 Assert(display == TEST_DISPLAY); 255 269 event_return->xany.type = g_SmlsEventType; 256 270 event_return->xany.window = g_SmlsEventWindow; … … 271 285 long event_mask, XEvent *event_send) 272 286 { 287 Assert(display == TEST_DISPLAY); 273 288 AssertFailedReturn(0); 274 289 } … … 278 293 int XFlush(Display *display) 279 294 { 295 Assert(display == TEST_DISPLAY); 280 296 AssertFailedReturn(0); 281 297 } … … 349 365 /** The event to delivered */ 350 366 int x11EventType; 351 /** The window sfor which the event in @enmEvent is delivered */367 /** The window for which the event in @enmEvent is delivered */ 352 368 Window hEventWindow; 353 369 /** The number of windows expected to be reported at the end of the … … 471 487 }; 472 488 473 /*** Test fixture to test the code against X11 unmap events ***/489 /*** Test fixtures to test the code against X11 unmap events ***/ 474 490 475 491 static XWindowAttributes g_aAttrib4After[] = … … 499 515 0, 500 516 NULL 517 }; 518 519 /*** A window we are not monitoring has been unmapped. Nothing should 520 *** happen, especially nothing bad. ***/ 521 522 static RTRECT g_aRects2[] = 523 { 524 { 100, 200, 150, 250 }, 525 { 150, 250, 300, 500 } 526 }; 527 528 static SMLSFIXTURE g_testUnmapOther = 529 { 530 RT_ELEMENTS(g_ahWin1), 531 g_ahWin1, 532 g_aAttrib1Before, 533 g_apszNames1, 534 20, 535 RT_ELEMENTS(g_aRectangle1), 536 g_aRectangle1, 537 RT_ELEMENTS(g_ahWin1), 538 g_ahWin1, 539 g_aAttrib1Before, 540 g_apszNames1, 541 20, 542 RT_ELEMENTS(g_aRectangle1), 543 g_aRectangle1, 544 UnmapNotify, 545 21, 546 RT_ELEMENTS(g_aRects2), 547 g_aRects2 501 548 }; 502 549 … … 650 697 cErrs += smlsDoFixture(&g_testMap, "MapNotify event"); 651 698 cErrs += smlsDoFixture(&g_testUnmap, "UnmapNotify event"); 699 cErrs += smlsDoFixture(&g_testUnmapOther, 700 "UnmapNotify event for unmonitored window"); 652 701 cErrs += smlsDoFixture(&g_testShape, "ShapeNotify event"); 653 702 if (cErrs > 0)
Note:
See TracChangeset
for help on using the changeset viewer.