Bug 312843 - Konsole does not use transparency when background image set
Summary: Konsole does not use transparency when background image set
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.9.3
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-07 20:41 UTC by jistanidiot
Modified: 2023-12-16 23:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.13


Attachments
setCompositionMode to Source when painting background (1.62 KB, patch)
2014-01-31 21:02 UTC, Wolfgang Brehm
Details
New Version of patch to fix error in previous ( do not check for useOpacity setting) (1.60 KB, patch)
2014-01-31 21:32 UTC, Wolfgang Brehm
Details
Proposed Patch for fixing Wallpaper transparency (3.35 KB, patch)
2014-02-10 21:16 UTC, Wolfgang Brehm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jistanidiot 2013-01-07 20:41:15 UTC
Set a background image for konsole and also set background transparency to something above 0%.  It will not be transparent.  However if one removes the background image then the transparency works.

Reproducible: Always

Steps to Reproduce:
1. Set both a background image and transparency.  
2.
3.
Actual Results:  
no transparency.  Background image completely opaque.  

Expected Results:  
Transparency.  One should be able to see through the background image.
Comment 1 Wolfgang Brehm 2013-05-04 18:58:38 UTC
Confirmed on KDE 4.10.2 on opensuse 12.3 x84-64
Also if you try to trick Konsole into using transparency with a wallpaper transparent itself, every action leaves some kind of visual trace or smear, but the window is only transparent for the very first frame, after that it seems the transparent image is added to itself over and over again.
This might even be an other bug, but highly related.
Comment 2 Wolfgang Brehm 2013-05-04 19:07:55 UTC
(In reply to comment #1)
> Confirmed on KDE 4.10.2 on opensuse 12.3 x84-64
> Also if you try to trick Konsole into using transparency with a wallpaper
> transparent itself, every action leaves some kind of visual trace or smear,
> but the window is only transparent for the very first frame, after that it
> seems the transparent image is added to itself over and over again.
> This might even be an other bug, but highly related.

I forgot, this was Konsole 2.10.2
Yakuake 2.9.9 is showing very similar behavoir, but no smear/trace
Comment 3 Wolfgang Brehm 2014-01-31 21:02:46 UTC
Created attachment 84925 [details]
setCompositionMode to Source when painting background

for also aplying the opacity setting correctly one would probably make a little bit bigger changes, for example in ColorSchemeWallpaper to set the opacity there.
Comment 4 Wolfgang Brehm 2014-01-31 21:08:09 UTC
I think I know what to do to let Konsole behave the way we expect it to, but I do not know how the Konsole developers would like it to be implemented. If one of them could step by to say what he thinks on this matter it would be very nice. I am happy to help in any way I can.
The patch allowes a transparent PNG to be chosen as backgound displaying transparently according to its opacity without smearing.
Comment 5 Wolfgang Brehm 2014-01-31 21:32:23 UTC
Created attachment 84927 [details]
New Version of patch to fix error in previous ( do not check for useOpacity setting)

error in the previous one that leads to misfunction, if transparency is set.
Comment 6 Wolfgang Brehm 2014-01-31 21:51:57 UTC
It is a little more complex than I thougt, sadly.
The background, if it is not the wallpaper is with the proposed patch incorrect.
I will think about it a little more and hopefully come back the next time with a proper solution.
Comment 7 Wolfgang Brehm 2014-01-31 22:01:40 UTC
It seems the first patch _is_ working how I expected... I am a little confused here...
Comment 8 Kurt Hindenburg 2014-02-09 14:51:10 UTC
Hello, your first patch works except the %opacity doesn't seem to work
Comment 9 Wolfgang Brehm 2014-02-09 14:57:15 UTC
(In reply to comment #8)
> Hello, your first patch works except the %opacity doesn't seem to work

I know, I could now that I know what the problem is easily get this to work also but I would have to change maybe 10 lines of code including extending the ColorSchemeWallpaper class that is being used, but I do not know if this is the way to go, but if you would like to just have it work, I will be glad providing a patch ;)
Comment 10 Kurt Hindenburg 2014-02-09 14:59:18 UTC
Yes, if you are willing to put together a patch please do and attach it - you could also upload it to reviewboard.kde.org w/ group as Konsole.
Thanks
Comment 11 Wolfgang Brehm 2014-02-10 21:16:44 UTC
Created attachment 85085 [details]
Proposed Patch for fixing Wallpaper transparency

everything should work as expected, but I had to introduce a _opacity variable, which seemed a little unelegant.
Comment 12 Kurt Hindenburg 2014-02-10 22:32:35 UTC
Thanks a lot - I'll commit after a few minor changes.
Comment 13 Kurt Hindenburg 2014-02-11 01:51:05 UTC
Git commit 09ca63dbb602a2c5d4d58fd6c9ee9206668cf1cd by Kurt Hindenburg.
Committed on 11/02/2014 at 01:47.
Pushed by hindenburg into branch 'master'.

Allow transparency to work when using images as backgrounds.

Previously when using an image as the background, the opacity was
ignored.  This patch corrects that.

Many thanks for patch to Wolfgang Brehm  wolfgang brehm gmail com
FIXED-IN: 2.13

M  +10   -1    src/ColorScheme.cpp
M  +1    -1    src/ColorScheme.h
M  +3    -1    src/TerminalDisplay.cpp
M  +2    -0    src/TerminalDisplay.h

http://commits.kde.org/konsole/09ca63dbb602a2c5d4d58fd6c9ee9206668cf1cd
Comment 14 Wolfgang Brehm 2014-02-12 19:37:47 UTC
Oh nice :D
This community seems to work beautifully, I am really encouraged to fix other bugs in my free time. Definitely the next time one is bugging me ;)
Comment 15 Kurt Hindenburg 2014-02-17 14:22:13 UTC
Git commit d5d2d9ef0d41f2906f6995707b652b3260228f40 by Kurt Hindenburg.
Committed on 11/02/2014 at 01:47.
Pushed by hindenburg into branch 'frameworks'.

Allow transparency to work when using images as backgrounds.

Previously when using an image as the background, the opacity was
ignored.  This patch corrects that.

Many thanks for patch to Wolfgang Brehm  wolfgang brehm gmail com
FIXED-IN: 2.13
(cherry picked from commit 09ca63dbb602a2c5d4d58fd6c9ee9206668cf1cd)

M  +10   -1    src/ColorScheme.cpp
M  +1    -1    src/ColorScheme.h
M  +3    -1    src/TerminalDisplay.cpp
M  +2    -0    src/TerminalDisplay.h

http://commits.kde.org/konsole/d5d2d9ef0d41f2906f6995707b652b3260228f40
Comment 16 Bug Janitor Service 2023-12-01 01:35:22 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/933
Comment 17 Kurt Hindenburg 2023-12-16 23:57:03 UTC
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 477800, bug 157882

M  +2    -2    src/terminalDisplay/TerminalPainter.cpp

https://invent.kde.org/utilities/konsole/-/commit/8939910b61f2b9fd035a9bf9292dcdbda7ef17eb