小编Vic*_*ran的帖子

XRender 创建离屏图片

我正在尝试创建一个合成窗口管理器。到目前为止它可以工作,但是当一个窗口覆盖另一个窗口时,它会像疯了一样闪烁。我发现这是因为我正在创建一个Picture,然后在它上面绘画,这导致它在屏幕上绘画。

我想要的行为是有一个Picture可以绘制的屏幕外,然后使用 XComposite 将其绘制到屏幕窗口。有没有办法让屏幕外Picture的大小与根窗口相同?

到目前为止(这段代码在无限循环中运行):

Window root, parent, *children;
uint children_count;
XQueryTree(disp, DefaultRootWindow(disp), &root, &parent, &children, &children_count);

// I'd like the following picture to be offscreen.
// I suspect that I have to put else something where rootPicture is
// Currently, when I draw to this picture, X11 renders it to the screen immediately, which is what I don't want.
Picture pictureBuf = XRenderCreatePicture(disp, /* rootPicture */, XRenderFindVisualFormat(disp, DefaultVisual(disp, DefaultScreen(disp))), CPSubwindowMode, &RootAttributes);

for (uint …
Run Code Online (Sandbox Code Playgroud)

c++ x11 xlib

5
推荐指数
1
解决办法
799
查看次数

Qt Creator中的Valgrind

使用Qt Creator的Memcheck功能返回以下内容:

valgrind: Bad option: --xml=yes, but no XML destination specified
valgrind: --xml=yes has been specified, but there is no XML output
valgrind: destination.  You must specify an XML output destination
valgrind: using --xml-fd, --xml-file or --xml-socket.
valgrind: Use --help for more information or consult the user manual.
Analyzing finished.
** Unknown error **
Run Code Online (Sandbox Code Playgroud)

配置中是否存在未正确设置的内容,或者这是否是Qt Creator错误?我无法在可能注入命令行参数或设置XML文件输出的设置中看到任何地方.

qt-creator

3
推荐指数
1
解决办法
1245
查看次数

标签 统计

c++ ×1

qt-creator ×1

x11 ×1

xlib ×1