Created attachment 136081 [details] OpenGL Rendering fault with Scantailor - I can provide examples from at least 3 more apps if necessary SUMMARY I am experiencing numerous issues related to Qt-based software with OpenGL(ES)-accelerated graphical interfaces. The part of the application that should be drawn by Qt OpenGL(ES) is either completely invisible (on Wayland, even the application or wallpaper behind is shown), and/or severely suffering from rendering artifacts / flickering. Some affected/tested applications: - Gwenview (activate OpenGL in settings) [neon package] - OBS Studio [neon package] - ScanTailor Advanced (activate OpenGL in settings) [self-built] - Olive Video Editor 0.1 branch [ubuntu package] - Olive Video Editor 0.2 branch [self-built] The enormous similarity of the issues, affecting both official builds from neon and self-built applications, makes me think that this problem may likely be caused by malconfigured Qt OpenGL(ES) packages in KDE Neon. It is rather unplausible that these problems are caused by my setup or configuration since all non-Qt OpenGL-related stuff works well. STEPS TO REPRODUCE 1. Install or build one of the applications mentioned above (or, potentially, any application depending on libqt5gui5-gles or libqt5opengl5) 2. Open the respective application and (if necessary) activate OpenGL (there might be a need to restart) 3. Open/load an image, video, or whatever OBSERVED RESULT Applications using Qt OpenGL modules do not render footage/media at all, or only with extreme flickering and rendering artifacts. -> On Wayland, you will see the application behind (or the desktop wallpaper) in the frame where the footage should be rendered -> On X11, you will see nothing (only the background colour) EXPECTED RESULT Content should render at all on Qt-OpenGL(ES), and without artifacts or flickering. The stuff behind should not be visible in the content frame. SOFTWARE/OS VERSIONS Operating System: KDE neon 5.21 KDE Plasma Version: 5.21.0 KDE Frameworks Version: 5.79.0 Qt Version: 5.15.2 Linux Kernel Version: 5.4.0-66-generic OS Type: 64-bit Graphics Platform: Wayland (X11 is affected as well) Processors: 4 × Intel® Core™ i5-3570K CPU @ 3.40GHz Memory: 7.2 GiB of RAM Graphics Processor: Mesa DRI Intel® HD Graphics 4000 ADDITIONAL INFORMATION - The issue already existed in previous versions of neon (5.20) - A possible idea is that a partial cause might be the libqt5gui5-gles package, which is not installable as it's still the Ubuntu version (but this cannot be the only reason, since Gwenview does not depend on this package, but is affected too) - I am not certain whether this is related or not, but my self-built OpenToonz (latest stable release tarball) crashes on startup with a segmentation fault because the EGL context could not be created (only on Wayland, though; it at least comes up on X11) DISCLAIMER Although I believe these problems might be caused by neon packaging mistakes, I am not sure; it's nothing but an assumption. I might easily be wrong (it could even be an issue with Qt, for instance, or something hardware specific). However, I chose to report this here because the distribution seems like the first place to ask for help. NOTES ON REPRODUCIBILITY Information on whether other users can reproduce this issue or not would be important. Reproducibility might also depend on the hardware / drivers used.
More screenshots: https://www.magentacloud.de/share/txdrb5363v
These are bugs in the client apps. Please file bugs there. Gwenview has a bug report OBS I fixed recently Can you file bugs on the others and link me, so I can help them, with a common problem
Relevant OBS https://github.com/obsproject/obs-studio/pull/3782
Okay, then I was entirely wrong, sorry ;) I will file bug reports with Olive and OpenToonz as soon as I have enough free time. ScanTailor Advanced is, it seems, abandoned by its developper, but I can make a report nevertheless.
I guess the Gwenview bug you meant is https://bugs.kde.org/show_bug.cgi?id=403323 ? It got addressed recently, maybe the way how it was fixed in Gwenview is also something to point at in the bug reports.
I just filed a bug report with Olive: https://github.com/olive-editor/olive/issues/1507
I filed another bug report with NodeGraphQt: https://github.com/jchanvfx/NodeGraphQt/issues/207
I think I have found the cause for Scantailor Advanced: It's the same as with Gwenview and NodeGraphQt - the deprecated QGLWidget. I ran a recursive grep across the source tree which found: ``` src/core/ImageViewBase.cpp:#include <QGLWidget> src/core/ImageViewBase.cpp: setViewport(new QGLWidget(format)); ```
Please file a bug with Scantailor
I have created a simple patch for STA that appears to work for me (first time ever that I write some c++). I'm not sure what to do about this format thing. Is it still necessary for QOpenGLWidget? If so, how do you do it? I looked at QSurfaceFormat but it appears not to provide the methods used. 10c10,11 < #include <QGLWidget> --- > // #include <QGLWidget> > #include <QOpenGLWidget> 152,158c153,159 < QGLFormat format; < format.setSampleBuffers(true); < format.setStencil(true); < format.setAlpha(true); < format.setRgba(true); < format.setDepth(false); < --- > //QGLFormat format; > //format.setSampleBuffers(true); > //format.setStencil(true); > //format.setAlpha(true); > //format.setRgba(true); > //format.setDepth(false); > 160,162c161,163 < format.setDirectRendering(false); < < setViewport(new QGLWidget(format)); --- > //format.setDirectRendering(false); > > setViewport(new QOpenGLWidget());
ScanTailor Advanced is unmaintained, so filing a bug is pointless, sadly. I'll upload the patch to my personal STA repository soon.
What I find really confusing, ScanTailor Experimental by the original author Joseph Artsimovich uses QGLWidget, too, but there it actually works on Wayland, and it's way faster too. Not sure why. See https://github.com/Tulon/scantailor/blob/experimental/ImageViewBase.cpp
Oh, I just see Qt/OpenGL support behind an ifdef guard in STE: ``` #ifdef ENABLE_OPENGL #include <QGLWidget> #include <QGLFormat> #endif ``` Probably I just built without it and the setting got silently ignored, that would be a good explanation.
* is behind
I've just found another app with this problem, this time from KDE again: KDiff3. This has been introduced recently (-> regression) and causes the most terrible flickering and artifacts I'd ever seen. Also, none of the buttons to select a file work anymore. I'll file bug reports with KDiff3, unless someone else has already done so.
Created attachment 138350 [details] kdiff3 transparency and flickering
I finally uploaded the ScanTailor Advanced patch: https://github.com/4lex4/scantailor-advanced/pull/179/files