SUMMARY *** I'm running Rocky Linux 9. My window manager is FVWM3. I have background images configured, but konsole displays a blank (black) background. *** STEPS TO REPRODUCE 1. Under Rocky Linux 9 with FVWM3 as a window manager, run konsole. 2. Configure a background in a profile. 3. Run konsole using that profile. OBSERVED RESULT Konsole's background is blank (black). EXPECTED RESULT Konsole's background is the image that was configured. SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: Rocky 9 - 9.3 (Blue Onyx) - Linux 5.14.0-362.8.1.el9_3.x86_64 (available in About System) KDE Plasma Version: 5.27.6 KDE Frameworks Version: 5.108.0 Qt Version: 5.15.9 ADDITIONAL INFORMATION I can make konsole behave normally (the way that I expect) by reverting the following change: ``` git diff 57c9a6856439926972f217f61ad4a4e23ebbe0cc 1e611bd45870c0f094a480610633ec85f1f330a2 diff --git a/src/Part.cpp b/src/Part.cpp index 4a7cb601b..88ddfa3d1 100644 --- a/src/Part.cpp +++ b/src/Part.cpp @@ -60,8 +60,10 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &) action->setShortcutContext(Qt::WidgetWithChildrenShortcut); } - // Enable translucency support. - _viewManager->widget()->setAttribute(Qt::WA_TranslucentBackground, true); + // Enable translucency support if supported by the app. + if (_viewManager->widget()->window() && _viewManager->widget()->window()->testAttribute(Qt::WA_TranslucentBackground)) { + _viewManager->widget()->setAttribute(Qt::WA_TranslucentBackground, true); + } // create basic session createSession(); diff --git a/src/terminalDisplay/TerminalDisplay.cpp b/src/terminalDisplay/TerminalDisplay.cpp index a685e9d68..794e4ff68 100644 --- a/src/terminalDisplay/TerminalDisplay.cpp +++ b/src/terminalDisplay/TerminalDisplay.cpp @@ -697,7 +697,11 @@ void TerminalDisplay::paintEvent(QPaintEvent *pe) for (const QRect &rect : region) { dirtyImageRegion += widgetToImage(rect); - _terminalPainter->drawBackground(paint, rect, _terminalColor->backgroundColor(), true /* use opacity setting */); + // We can use the opacity settings only if we are in a top level window which actually supports opacity. + // Many apps that use a konsole part such as kate or dolphin don't for performance reasons. + // This will result in repaint glitches iin wayland due to missing damage information + const bool useOpacity = window() && window()->testAttribute(Qt::WA_TranslucentBackground); + _terminalPainter->drawBackground(paint, rect, _terminalColor->backgroundColor(), useOpacity); } if (_displayVerticalLine) { ``` I have no interest in transparency. I think that this two line "fix" needs to be reverted and replaced with something a little more nuanced. It seems that whether or not background images are displayed is orthogonal to whether or not an application supports transparency.
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/933
Git commit 8939910b61f2b9fd035a9bf9292dcdbda7ef17eb by Kurt Hindenburg, on behalf of Luis Javier Merino Morán. Committed on 16/12/2023 at 18:25. Pushed by hindenburg into branch 'master'. Show wallpaper on non-translucent top-levels For reasons, showing the background image (wallpaper) has become dependant on the ability of the top-level window to be translucent. This does not need to be so. Since 5bac30ab3, to draw the wallpaper, first a background color is used to fill the dirty region, and then the wallpaper is drawn, and the opacity of the background color and the wallpaper are separate, so we can fill with a totally opaque background color, and then draw a maybe translucent wallpaper over that, and no glitches should appear. Related: bug 312843, bug 157882 M +2 -2 src/terminalDisplay/TerminalPainter.cpp https://invent.kde.org/utilities/konsole/-/commit/8939910b61f2b9fd035a9bf9292dcdbda7ef17eb