VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/VBoxClient/seamless.cpp@ 49762

Last change on this file since 49762 was 48487, checked in by vboxsync, 11 years ago

Additions and HostServices: remove unneeded calls to XInitThreads().

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.4 KB
Line 
1/** @file
2 *
3 * Guest client: seamless mode.
4 */
5
6/*
7 * Copyright (C) 2006-2012 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#include <unistd.h>
19
20#include <X11/Xlib.h>
21
22#include "VBoxClient.h"
23#include "seamless.h"
24
25class SeamlessService : public VBoxClient::Service
26{
27private:
28 VBoxGuestSeamless mSeamless;
29public:
30 virtual const char *getPidFilePath()
31 {
32 return ".vboxclient-seamless.pid";
33 }
34 virtual int run(bool fDaemonised /* = false */)
35 {
36 int rc = mSeamless.init();
37 if (RT_FAILURE(rc))
38 return rc;
39 /* Stay running as long as X does... */
40 Display *pDisplay = XOpenDisplay(NULL);
41 XEvent ev;
42 while (true)
43 XNextEvent(pDisplay, &ev);
44 return VERR_INTERRUPTED;
45 }
46 virtual void cleanup()
47 {
48 VbglR3SeamlessSetCap(false);
49 }
50};
51
52VBoxClient::Service *VBoxClient::GetSeamlessService()
53{
54 return new SeamlessService;
55}
Note: See TracBrowser for help on using the repository browser.

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