VirtualBox

Changeset 18938 in vbox for trunk/src


Ignore:
Timestamp:
Apr 16, 2009 1:15:52 PM (16 years ago)
Author:
vboxsync
Message:

Additions/x11/VBoxClient: detect X server termination and remove two unused files

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

Legend:

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

    r18360 r18938  
    2727#include <errno.h>
    2828
     29#include <X11/Xlib.h>
     30
     31#include <iprt/assert.h>
     32#include <iprt/thread.h>
    2933#include <VBox/log.h>
    3034#include <VBox/VBoxGuest.h>
    31 #include <iprt/assert.h>
    32 #include <iprt/thread.h>
    3335
    3436#include "VBoxClient.h"
     
    7375{
    7476    LogFlowFunc(("\n"));
     77    /* Keep an open display so that we terminate if X11 does. */
     78    Display *pDisplay = XOpenDisplay(NULL);
    7579    uint32_t cx0 = 0, cy0 = 0, cBits0 = 0, iDisplay0 = 0;
    7680    int rc = VbglR3GetLastDisplayChangeRequest(&cx0, &cy0, &cBits0, &iDisplay0);
     
    7983        uint32_t cx = 0, cy = 0, cBits = 0, iDisplay = 0;
    8084        rc = VbglR3DisplayChangeWaitEvent(&cx, &cy, &cBits, &iDisplay);
     85        /* Make sure we are still connected to X.  If the X server has
     86         * terminated then we should get a resize event above. */
     87        XPending(pDisplay);
    8188        /* Ignore the request if it is stale */
    8289        if ((cx != cx0) || (cy != cy0))
     
    93100        cy0 = 0;
    94101    }
     102    XCloseDisplay(pDisplay);
    95103    LogFlowFunc(("returning VINF_SUCCESS\n"));
    96104    return VINF_SUCCESS;
  • trunk/src/VBox/Additions/x11/VBoxClient/main.cpp

    r18360 r18938  
    2929#include <signal.h>
    3030
     31#include <X11/Xlib.h>
     32
    3133#include <iprt/env.h>
    3234#include <iprt/initterm.h>
     
    3840
    3941#include "VBoxClient.h"
    40 
    41 #ifdef DYNAMIC_RESIZE
    42 # include "displaychange.h"
    43 # ifdef SEAMLESS_GUEST
    44 #  include "seamless.h"
    45 # endif
    46 #endif
    4742
    4843#define TRACE RTPrintf("%s: %d\n", __PRETTY_FUNCTION__, __LINE__); Log(("%s: %d\n", __PRETTY_FUNCTION__, __LINE__))
  • trunk/src/VBox/Additions/x11/VBoxClient/seamless.cpp

    r18360 r18938  
    4545        }
    4646        mSeamless.init();
    47         pause();
     47        /* Stay running as long as X does... */
     48        Display *pDisplay = XOpenDisplay(NULL);
     49        XEvent ev;
     50        while (true)
     51            XNextEvent(pDisplay, &ev);
    4852        return VERR_INTERRUPTED;
    4953    }
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