示例#1
0
void CompMgr::run()
{
	dpy = XOpenDisplay(0);
	::createAtomList();
	XSetErrorHandler (error);
	if (!XRenderQueryExtension (dpy, &render_event, &render_error))
	{
		fprintf (stderr, "No render extension\n");
		return;
    }
	if (!XDamageQueryExtension (dpy, &damage_event, &damage_error))
	{
		fprintf (stderr, "No damage extension\n");
		return;
	}
	if (!XFixesQueryExtension (dpy, &xfixes_event, &xfixes_error))
	{
		fprintf (stderr, "No XFixes extension\n");
		return;
	}
	if (!register_cm(dpy))
		return;
	Workspace* workspace = Workspace::instance();
	qDebug("Composite Manager started.");
	while (!m_stop)
	{
		XEvent event;
		XNextEvent( dpy, &event );
		workspace->x11Event( &event );
	}
	qDebug("Composite Manager stopped.");
	delete workspace;
	XCloseDisplay (dpy);
}
示例#2
0
int main(/* int argc, char **argv*/)
{
    dpy = XOpenDisplay( 0 );

    ::createAtomList();

    XSetErrorHandler (error);

    register_cm();

    Workspace *workspace = Workspace::instance();

    while (true)
    {
        XEvent event;
        XNextEvent( dpy, &event );
        workspace->x11Event( &event );
    }

    delete workspace;
    XCloseDisplay (dpy);
}