Solved Linux 平台的 QT 程序在 X11 Intel modesetting 环境下屏幕撕裂,如何解决?
-
我的 Linux 使用 X11 图形系统, Intel 核芯显卡。所有的 QT4 和 QT5 程序都会出现屏幕撕裂现象,严重影响使用。但假如不使用 Xorg 的 modesetting 驱动,而是用陈旧的 intel DDX 驱动,就不会出现撕裂。然而 intel DDX 驱动已经处于废弃状态, Mesa 等基础软件都不再关心该驱动。如果硬要使用 intel DDX 驱动,那么用不了 GPU 加速。
可以参考这里:
https://wiki.archlinux.org/title/intel_graphics#Installation
Note: Some (Debian & Ubuntu, Fedora, KDE) recommend not installing the xf86-video-intel driver, and instead falling back on the modesetting driver for Gen4 and newer GPUs (GMA 3000 from 2006 and newer). See [1], [2], Xorg#Installation, and modesetting(4). However, the modesetting driver can cause problems such as screen tearing and mouse jittering on XFCE, artifacts when switching virtual desktops in Chromium, and vsync jitter/video stutter in mpv.
对于 Intel 显卡,屏幕撕裂问题非常普遍。对于 QT 程序,有无特定的解决办法?
-
This is intel driver's problem. I do not think Qt will handle it. Ask the guys who make intel drivers how to handle this. It is likely you have to upgrade your card and the drivers. If your card is too old, they will not bother to help you. I have the issue of memory leaks if vaapi is applied. Vaapi is being dropped and a new one is supposed to replace it.
Also it may be better to switch to NVidia which has better support.
-
谢谢您的回复。
Intel 显卡的 X11 modesetting 驱动容易出现屏幕撕裂问题,这已经是许多用户都遇到过的现象。似乎暂时没办法从驱动层解决,因此只能想办法让应用程序不要触发到这个问题。比如 Linux 下的 GTK 程序就不会出现屏幕撕裂,而火狐 Firefox 浏览器容易出现屏幕撕裂,却可以通过修改火狐的配置选项避免。
不知道 QT 是否可以修改某些配置文件或者环境变量避免这个问题,我觉得应该不是只有我才遇到过这种现象。
-
现在找到原因了,是因为我用的不是那种标准桌面系统,而是简单的窗口管理器。简单的窗口管理器不带 Compositor 功能,偏偏 QT 需要该功能。装上 Compositor 就好了,一切正常了。