Display issues with QT applications on Ubuntu22.04
-
While working with Ubuntu 22.04, I was facing an issue with display of QT applications, even with the QT creator application itself (Screenshots attached). The issue is like when we open an application(excluding system applications) it just displays a black screen and being presented in unusable form.
In order to display the text, buttons and other contents of the application, I need to hover mouse over them but still the application is not readable format making it difficult to work
Moreover when scrolling up/down it keeps on displaying the same content over and over again. But after logging out and changing the setting from Ubuntu to Ubuntu on Xorg
I do not face this issue
So I want to ask that how this issue with the QT applications can be resolved for Ubuntu setting as well without changing it to Ubuntu on Xorg.
-
Hi and welcome to devnet,
Are you using the Qt version provided by your distribution ?
If not, did you check which QPA plugin gets loaded ?
-
Use the QT_DEBUG_PLUGINS environment set to 1 and start your application. You'll have a complete log of the plugins loading.
-
@SGaist I first ran export QT_DEBUG_PLUGINS=1 and then launched qtcreator via terminal. Following are the QPA plugins that showed up in terminal:
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"eglfs"
]
},
"archreq": 0,
"className": "QEglFSIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("eglfs")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"linuxfb"
]
},
"archreq": 0,
"className": "QLinuxFbIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("linuxfb")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimal.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimal.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"minimal"
]
},
"archreq": 0,
"className": "QMinimalIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("minimal")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"minimalegl"
]
},
"archreq": 0,
"className": "QMinimalEglIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("minimalegl")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"offscreen"
]
},
"archreq": 0,
"className": "QOffscreenIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("offscreen")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqvnc.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqvnc.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"vnc"
]
},
"archreq": 0,
"className": "QVncIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("vnc")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"xcb"
]
},
"archreq": 0,
"className": "QXcbIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
loaded library "Xcursor"
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/libqgtk3.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/libqgtk3.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1",
"MetaData": {
"Keys": [
"gtk3"
]
},
"archreq": 0,
"className": "QGtk3ThemePlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("gtk3")
QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platformthemes" ...
loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/libqgtk3.so"
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so, metadata=
{
"IID": "org.qt-project.Qt.QPlatformInputContextFactoryInterface.5.1",
"MetaData": {
"Keys": [
"compose",
"xim"
]
},
"archreq": 0,
"className": "QComposePlatformInputContextPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("compose", "xim")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so, metadata=
{
"IID": "org.qt-project.Qt.QPlatformInputContextFactoryInterface.5.1",
"MetaData": {
"Keys": [
"ibus"
]
},
"archreq": 0,
"className": "QIbusPlatformInputContextPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("ibus")
QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforminputcontexts" ...
loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so"
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/x86_64-linux-gnu/qt5/plugins/xcbglintegrations" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/xcbglintegrations/libqxcb-egl-integration.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/xcbglintegrations/libqxcb-egl-integration.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5",
"MetaData": {
"Keys": [
"xcb_egl"
]
},
"archreq": 0,
"className": "QXcbEglIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("xcb_egl")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux-gnu/qt5/plugins/xcbglintegrations/libqxcb-glx-integration.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/xcbglintegrations/libqxcb-glx-integration.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5",
"MetaData": {
"Keys": [
"xcb_glx"
]
},
"archreq": 0,
"className": "QXcbGlxIntegrationPlugin",
"debug": false,
"version": 331520
} -
That seems to be only the finding part, did you have other related messages about the plugins actually loaded ?
-
@sparmar said in Display issues with QT applications on Ubuntu22.04:
So I want to ask that how this issue with the QT applications can be resolved for Ubuntu setting as well without changing it to Ubuntu on Xorg.
Are you running Ubuntu in a VM, by any chance?
One way is to use the Wayland platform plugin instead of the XCB platform plugin.
-
@JKSH Yes I am running Ubuntu VM (VMware fusion). Yes by default my system was wayland but I was facing this issue so I changed it to Xorg. Could you please let me know which wayland plugins/packages will be required to get it working in wayland.
-
@sparmar said in Display issues with QT applications on Ubuntu22.04:
Yes I am running Ubuntu VM (VMware fusion).
It looks like the problem is caused by some interaction between Ubuntu 22.04 with VMware. I've seen the same issue in Ubuntu 22.04, but not in Ubuntu 20.04.
Yes by default my system was wayland but I was facing this issue so I changed it to Xorg.
Yes, Ubuntu uses Wayland by default now.
Could you please let me know which wayland plugins/packages will be required to get it working in wayland.
I don't know what plugins are available with the version of Qt Creator supplied by the Ubuntu repositories. However, if you install Qt and Qt Creator with the official installer, then you just need to start Qt Creator with the
-platform wayland
command line argument. (Alternatively, set the environment variable,QT_QPA_PLATFORM=wayland
) -
@JoeCFD said in Display issues with QT applications on Ubuntu22.04:
Why does not Qt creator recognize wayland automatically and set things properly? $XDG_SESSION_TYPE tells it, right?
Good question! Here's what I found:
- XDG_SESSION_TYPE was originally ignored on purpose on the GNOME Shell due to some serious bugs: https://bugreports.qt.io/browse/QTBUG-68619
- XDG_SESSION_TYPE is non-standard, so Qt later replaced it with DISPLAY/WAYLAND_DISPLAY instead: https://bugreports.qt.io/browse/QTBUG-75732
- https://codereview.qt-project.org/c/qt/qtbase/+/369443 is supposed to remove the code that ignores the environment, but AFAICS Qt Creator 9.0.0-rc1 still ignores it and defaults to XCB somehow.
-
@JoeCFD said in Display issues with QT applications on Ubuntu22.04:
This does not make sense and causes inconvenience for users who do not know this.
Why would it inconvenience anyone? X clients can (usually) display just fine under Wayland.
Wayland is the default setting on Ubuntu. But qt creator does not do the same thing.
The links in my previous post explain why XCB was set as default under the GNOME shell. Feel free to open a new ticket to suggest changing this.