VirtualBox

Changeset 21940 in vbox


Ignore:
Timestamp:
Aug 3, 2009 12:38:04 PM (16 years ago)
Author:
vboxsync
Message:

Additions/X11/VBoxClient: attempt to fix seamless Additions crashes

Location:
trunk/src/VBox/Additions/x11/VBoxClient
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/main.cpp

    r21922 r21940  
    8888    char errorText[1024];
    8989
    90     if (pError->error_code == BadAtom)
    91     {
    92         /* This can be triggered in debug builds if a guest application passes a bad atom
    93            in its list of supported clipboard formats.  As such it is harmless. */
    94         Log(("VBoxClient: ignoring BadAtom error and returning\n"));
    95         return 0;
    96     }
    97     if (pError->error_code == BadWindow)
    98     {
    99         /* This can be triggered if a guest application destroys a window before we notice. */
    100         Log(("VBoxClient: ignoring BadWindow error and returning\n"));
    101         return 0;
    102     }
    10390    XGetErrorText(pDisplay, pError->error_code, errorText, sizeof(errorText));
    104     LogRel(("VBoxClient: an X Window protocol error occurred: %s (error code %d).  Request code: %d, minor code: %d, serial number: %d\n", errorText, pError->error_code, pError->request_code, pError->minor_code, pError->serial));
    105     VBoxClient::CleanUp();
     91    LogRelFlow(("VBoxClient: an X Window protocol error occurred: %s (error code %d).  Request code: %d, minor code: %d, serial number: %d\n", errorText, pError->error_code, pError->request_code, pError->minor_code, pError->serial));
    10692    return 0;  /* We should never reach this. */
    10793}
  • trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp

    r21638 r21940  
    332332        XWindowAttributes winAttrib;
    333333
    334         if (XGetWindowAttributes(mDisplay, hWin, &winAttrib))
    335         {
    336             iter->second->mX = winAttrib.x;
    337             iter->second->mY = winAttrib.y;
    338             iter->second->mWidth = winAttrib.width;
    339             iter->second->mHeight = winAttrib.height;
    340         }
     334        if (!XGetWindowAttributes(mDisplay, hWin, &winAttrib))
     335            return;
     336        iter->second->mX = winAttrib.x;
     337        iter->second->mY = winAttrib.y;
     338        iter->second->mWidth = winAttrib.width;
     339        iter->second->mHeight = winAttrib.height;
    341340        if (iter->second->mhasShape)
    342341        {
     
    346345            rects = XShapeGetRectangles(mDisplay, hWin, ShapeBounding,
    347346                                        &cRects, &iOrdering);
     347            if (rects.get() == NULL)
     348                cRects = 0;
    348349            iter->second->mcRects = cRects;
    349350            iter->second->mapRects = rects;
     
    392393        rects = XShapeGetRectangles(mDisplay, hWin, ShapeBounding, &cRects,
    393394                                    &iOrdering);
     395        if (rects.get() == NULL)
     396            cRects = 0;
    394397        iter->second->mhasShape = true;
    395398        iter->second->mcRects = cRects;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette