系统相关
首页 > 系统相关> > linux – XServer:后台的活动xserver会话

linux – XServer:后台的活动xserver会话

作者:互联网

我需要运行一些程序,它通过xlib库在单独的xserver会话中捕获屏幕.所以,我开始我的ubuntu 14和原始xserver会话(让我们这样称呼它)开始,之后我运行

startx some-program

运行此命令后会出现一个黑屏,在这个黑屏上我看到我的程序,它按预期工作.没关系 – 这就是我需要的.

但是,首先我要使用我的计算机,其次我必须在N个单独的xserver会话中运行N个这样的程序.问题是,当我尝试通过按ctrl alt f7返回我的原始会话时某些程序继续工作,但是它的屏幕捕获变成简单的黑色矩形(没有任何内容).

如何在单独的xserver会话中启动我的某个程序并让它继续运行,因为我仍在使用该会话?

解决方法:

我在xorg邮件列表中得到了答案:

Using it this way is nearly impossible: for some historical reasons,
inactive server stops drawing. Well, not just historical: it is a
reasinable approach to stop wasting resources to draw unseen things.

However, you can start virtual X server (like standard Xvfb),and draw
on it just fine.

You can even try to work interactively with programs on that server
via something like x2x or x11vnc or x2godesktopsharing, however,
usually interactive experience is worse than with console server.

Also, no hardware 3D acceleration will be available. It also works
only on active console currently. If you need it, you can try to use
some server-in-window servers like xpra, however, it is not perfect
(and all attempts to implement it in the past — Xgl, AIGLX was not
perfect also).

标签:linux,x11,xorg,x-server
来源: https://codeday.me/bug/20190813/1648592.html