- Timestamp:
- Jul 3, 2009 11:13:33 PM (16 years ago)
- Location:
- trunk/src/VBox/Additions/x11/VBoxClient
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp
r21207 r21216 293 293 { 294 294 case ConfigureNotify: 295 doConfigureEvent( &event.xconfigure);295 doConfigureEvent(event.xconfigure.window); 296 296 break; 297 297 case MapNotify: 298 doMapEvent( &event.xmap);298 doMapEvent(event.xmap.window); 299 299 break; 300 300 case VBoxShapeNotify: /* This is defined wrong in my X11 header files! */ 301 doShapeEvent(reinterpret_cast<XShapeEvent *>(&event)); 301 /* the window member in xany is in the same place as in the shape event */ 302 doShapeEvent(event.xany.window); 302 303 break; 303 304 case UnmapNotify: 304 doUnmapEvent( &event.xunmap);305 doUnmapEvent(event.xunmap.window); 305 306 break; 306 307 default: … … 315 316 * @param event the X11 event structure 316 317 */ 317 void VBoxGuestSeamlessX11::doConfigureEvent( const XConfigureEvent *event)318 void VBoxGuestSeamlessX11::doConfigureEvent(Window hWin) 318 319 { 319 320 LogFlowThisFunc(("\n")); 320 321 VBoxGuestWindowList::iterator iter; 321 322 322 iter = mGuestWindows.find( event->window);323 iter = mGuestWindows.find(hWin); 323 324 if (iter != mGuestWindows.end()) 324 325 { 325 326 XWindowAttributes winAttrib; 326 327 327 if (XGetWindowAttributes(mDisplay, event->window, &winAttrib))328 if (XGetWindowAttributes(mDisplay, hWin, &winAttrib)) 328 329 { 329 330 iter->second->mX = winAttrib.x; … … 332 333 iter->second->mHeight = winAttrib.height; 333 334 } 335 if (iter->second->mhasShape) 336 { 337 VBoxGuestX11Pointer<XRectangle> rects; 338 int cRects = 0, iOrdering; 339 340 rects = XShapeGetRectangles(mDisplay, hWin, ShapeBounding, 341 &cRects, &iOrdering); 342 iter->second->mcRects = cRects; 343 iter->second->mapRects = rects; 344 } 334 345 } 335 346 LogFlowThisFunc(("returning\n")); … … 341 352 * @param event the X11 event structure 342 353 */ 343 void VBoxGuestSeamlessX11::doMapEvent( const XMapEvent *event)354 void VBoxGuestSeamlessX11::doMapEvent(Window hWin) 344 355 { 345 356 LogFlowThisFunc(("\n")); 346 357 VBoxGuestWindowList::iterator iter; 347 358 348 iter = mGuestWindows.find( event->window);359 iter = mGuestWindows.find(hWin); 349 360 if (mGuestWindows.end() == iter) 350 361 { 351 addClientWindow( event->window);362 addClientWindow(hWin); 352 363 } 353 364 LogFlowThisFunc(("returning\n")); … … 360 371 * @param event the X11 event structure 361 372 */ 362 void VBoxGuestSeamlessX11::doShapeEvent( const XShapeEvent *event)373 void VBoxGuestSeamlessX11::doShapeEvent(Window hWin) 363 374 { 364 375 LogFlowThisFunc(("\n")); 365 376 VBoxGuestWindowList::iterator iter; 366 377 367 iter = mGuestWindows.find( event->window);378 iter = mGuestWindows.find(hWin); 368 379 if (iter != mGuestWindows.end()) 369 380 { … … 371 382 int cRects = 0, iOrdering; 372 383 373 rects = XShapeGetRectangles(mDisplay, event->window, ShapeBounding, &cRects, &iOrdering); 384 rects = XShapeGetRectangles(mDisplay, hWin, ShapeBounding, &cRects, 385 &iOrdering); 374 386 iter->second->mhasShape = true; 375 387 iter->second->mcRects = cRects; … … 384 396 * @param event the X11 event structure 385 397 */ 386 void VBoxGuestSeamlessX11::doUnmapEvent( const XUnmapEvent *event)398 void VBoxGuestSeamlessX11::doUnmapEvent(Window hWin) 387 399 { 388 400 LogFlowThisFunc(("\n")); 389 401 VBoxGuestWindowList::iterator iter; 390 402 391 iter = mGuestWindows.find( event->window);403 iter = mGuestWindows.find(hWin); 392 404 if (mGuestWindows.end() != iter) 393 405 { -
trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.h
r21207 r21216 349 349 /* Methods to handle X11 events. These are public so that the unit test 350 350 * can call them. */ 351 void doConfigureEvent( const XConfigureEvent *event);352 void doMapEvent( const XMapEvent *event);353 void doUnmapEvent( const XUnmapEvent *event);354 void doShapeEvent( const XShapeEvent *event);351 void doConfigureEvent(Window hWin); 352 void doMapEvent(Window hWin); 353 void doUnmapEvent(Window hWin); 354 void doShapeEvent(Window hWin); 355 355 356 356 VBoxGuestSeamlessX11(void) -
trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11-auto.cpp
r21214 r21216 426 426 RT_ELEMENTS(g_aRectangle1), 427 427 g_aRectangle1, 428 MapNotify,428 ConfigureNotify, 429 429 20, 430 430 RT_ELEMENTS(g_aRects1), … … 563 563 pFixture->cShapeRectsAfter, 564 564 pFixture->paShapeRectsAfter); 565 XEvent event = { 0 };566 565 switch(pFixture->x11EventType) 567 566 { 568 567 case ConfigureNotify: 569 event.xconfigure.window = pFixture->hEventWindow; 570 subject.doConfigureEvent(&event.xconfigure); 568 subject.doConfigureEvent(pFixture->hEventWindow); 571 569 break; 572 570 case MapNotify: 573 event.xmap.window = pFixture->hEventWindow; 574 subject.doMapEvent(&event.xmap); 571 subject.doMapEvent(pFixture->hEventWindow); 575 572 break; 576 573 case UnmapNotify: 577 event.xunmap.window = pFixture->hEventWindow; 578 subject.doUnmapEvent(&event.xunmap); 574 subject.doUnmapEvent(pFixture->hEventWindow); 579 575 break; 580 576 case VBoxShapeNotify: 581 event.xany.window = pFixture->hEventWindow; 582 subject.doShapeEvent((XShapeEvent *)&event); 577 subject.doShapeEvent(pFixture->hEventWindow); 583 578 break; 584 579 default: … … 637 632 "ConfigureNotify event (window moved)"); 638 633 // Currently not working 639 //cErrs += smlsDoFixture(&g_testResize,640 //"ConfigureNotify event (window resized)");634 cErrs += smlsDoFixture(&g_testResize, 635 "ConfigureNotify event (window resized)"); 641 636 cErrs += smlsDoFixture(&g_testMap, "MapNotify event"); 642 637 cErrs += smlsDoFixture(&g_testUnmap, "UnmapNotify event");
Note:
See TracChangeset
for help on using the changeset viewer.