Bug 294975 - Intermittent shadow corruption on focus/unfocus windows
Summary: Intermittent shadow corruption on focus/unfocus windows
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: kdecorations (show other bugs)
Version: 4.8.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2012-02-28 00:20 UTC by Chris Dekter
Modified: 2018-10-27 03:32 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screen capture (335.09 KB, image/png)
2012-02-28 00:22 UTC, Chris Dekter
Details
Screen capture with Show Paint (334.53 KB, image/png)
2012-02-28 00:29 UTC, Chris Dekter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dekter 2012-02-28 00:20:50 UTC
Version:           4.8.0 (using KDE 4.8.0) 
OS:                Linux

When two windows are overlapping, after a few cycles of focus/unfocus the different windows (which causes the shadow to switch between blue and black), the shadow becomes corrupted. See attached screen photo (unable to capture with screenshot tool).

Reproducible: Sometimes

Steps to Reproduce:
Open two windows and arrange them so they overlap.
Switch focus between the two windows and the desktop (by clicking on the desktop).

Actual Results:  
After a few cycles, the overlapping area of shadows becomes corrupted.

Expected Results:  
Shadows are not corrupted.

Have tested this on two systems with totally different graphics (on Radeon 6770 and on Intel 3000 Sandy Bridge), and they both exhibit the same behaviour. Have not noticed this issue in earlier versions of Kwin (but can't say for sure when it was introduced).
Comment 1 Chris Dekter 2012-02-28 00:22:03 UTC
Created attachment 69154 [details]
Screen capture
Comment 2 Chris Dekter 2012-02-28 00:29:14 UTC
Created attachment 69155 [details]
Screen capture with Show Paint

Using the Show Paint plugin it is clear that the corruption is caused by not properly triggering redraw of the shadowed areas.
Comment 3 Thomas Lübking 2012-02-28 00:48:01 UTC
- XRender or OpenGL backend (kcmshell4 kwincompositing, 3rd tab)
- list of enabled effect plugins?
grep -iE 'kwin4_effect_.*Enabled=true' `kde4-config --path config | cut -d":" -f1`/kwinrc | sed -e 's/kwin4_effect_//g; s/Enabled=true//g'
(it's a one liner in case bugzilla breaks the line)
- is overlapping or the desktop invocation stringent necessity?
- does the focus change interval have impact (ie "occurs only with fast swaps")
Comment 4 Chris Dekter 2012-02-28 01:10:22 UTC
Backend: OpenGL
Enabled plugins:
blur
boxswitch
coverswitch
cube
dashboard
desktopgrid
fade
login
logout
minimizeanimation
outline
presentwindows
screenshot
startupfeedback
taskbarthumbnail
translucency
zoom

On further review, overlapping is not required, it just makes the problem more obvious. Desktop focusing is not needed - you can get the corruption simply by opening two non-overlapping window and using the mouse to switch back and forth between them. Interval of switching does not seem to have an impact.

Not sure if relevant, but my window focus policy is set to click-to-focus.
Comment 5 Thomas Lübking 2012-02-28 01:13:35 UTC
please try to disable blurring and translucency
if it's not longer reproducible please try w/ only one or the other and share your observations
Comment 6 Chris Dekter 2012-02-28 01:20:41 UTC
I noticed no change in the problem behaviour with any combination of blur or translucency enabled or disabled.

A bit more testing reveals that the problem disappears if I enable animations in the Oxygen window decoration. (I disable them normally because they cause a performance hit on Radeon open drivers).
Comment 7 Thomas Lübking 2012-02-28 01:27:27 UTC
"A bit more testing reveals that the problem disappears if I enable animations
in the Oxygen window decoration."

@Hugo
Any chance that the single repaint trigger only covers the smaller region?
Comment 8 Chris Dekter 2012-02-28 01:46:45 UTC
I suspect what is really happening is that with animations off the repaint of the window border/shadow area is now always triggering. When windows overlap, one of the two windows might trigger the repaint and then only part of the shadow of the second window is repainted. If windows don't overlap, no part of the second window border is repainted - you can actually end up with two windows with a 'focus-coloured' shadow.
Comment 9 Hugo Pereira Da Costa 2012-02-28 08:49:56 UTC
@Chris:
I can reproduce the issue (with animations off) and the non-issue (with animations on).

I checked the oxygen code.
When animations are on, each "opacity" change in the transition triggers a full client->widget repaint. Hence no issue.

When animations are off, there is no update/repaint triggered inside oxygen, since I assumed that kwin would do that for me. This is likely what is not working.
The *titlebar* gets repainted, as well as the overlapping region between the two windows, but not the full windows (as it should).

maybe there is too much "optimization" on the kwin side ?

I tried to explicitely trigger update (client->widget()->update()) in Client::activeChange(), but this did not fix anything.
Also tried "->repaint()" without success.

Hugo
Comment 10 Hugo Pereira Da Costa 2012-02-29 01:23:16 UTC
For the record, this is "magically" fixed with new shadow system (using X11 Hints).

cd kde-workspace
git checkout hpereira/oxygen-shadows

Now, this is not merge (yet) to master because there are other (minor) issues.
Will send email to kwin devs.
Comment 11 Thomas Lübking 2012-02-29 01:31:46 UTC
No magic involved. Was actually broken for OpenGL in < 4.7.3 but i fixed it ;-)
(Changing the property triggers an update)
Comment 12 Chris Dekter 2012-03-14 01:54:42 UTC
So the status of this is... will be fixed in 4.9? Just curious...
Comment 13 Andrew Crouthamel 2018-09-23 02:20:54 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 14 Andrew Crouthamel 2018-10-27 03:32:01 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!