Bug 356328 - Moving the cursor and moving windows leaves drawing artefacts in with the Framebuffer backend
Summary: Moving the cursor and moving windows leaves drawing artefacts in with the Fra...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: platform-fbdev (other bugs)
Version First Reported In: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 364720 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-12-06 02:14 UTC by bluescreenavenger
Modified: 2016-06-29 17:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:
mgraesslin: ReviewRequest+


Attachments
Photo of the drawing artifacts with fbdev (1.77 MB, image/jpeg)
2015-12-06 02:19 UTC, bluescreenavenger
Details
drawing glitch also goes within applications that are not moved (qt wiggly test) (1.48 MB, image/jpeg)
2015-12-09 02:21 UTC, bluescreenavenger
Details
the drawing glitches affecting qpainter in the wayland backend (557.67 KB, image/png)
2015-12-09 13:19 UTC, bluescreenavenger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bluescreenavenger 2015-12-06 02:14:29 UTC
It seems that by switching the false in FramebufferQPainterBackend::needsFullRepaint() const 
to true fixes this issue. not sure if it's false for performance reasons... but the one for the wayland backend seems to set needsFullRepaint to true...



Reproducible: Always
Comment 1 bluescreenavenger 2015-12-06 02:19:25 UTC
Created attachment 95912 [details]
Photo of the drawing artifacts with fbdev
Comment 2 bluescreenavenger 2015-12-06 12:40:25 UTC
For this I attempted to create https://git.reviewboard.kde.org/r/126254/
Comment 3 Thomas Lübking 2015-12-06 14:45:07 UTC
I think we've two bugs here:

1. the old mousecursor area isn't marked damaged at all?
2. The old geometry is repainted insufficiently or not at all.

What happens if you move the window to the down-right?
Does it make a difference how fast you move the window?
Do you get artifacts when closing/minimizing windows (with every animation DISabled)?
Comment 4 bluescreenavenger 2015-12-07 12:47:15 UTC
Moving the window to the bottom right hand corner does bring up the semi-transparent window resize thing. anything under it does seem to refresh


I can move the window slowly and fast, I get more artifacts moving it slow, then moving it fast.


It doesn't seem closing the window gives any artifacts
Comment 5 Thomas Lübking 2015-12-07 14:07:30 UTC
(In reply to bluescreen_avenger from comment #4)
> Moving the window to the bottom right hand corner does bring up the
> semi-transparent window resize thing.

No, I meant whether you get similar artifacts but on the top-left of the window =)
Comment 6 bluescreenavenger 2015-12-08 12:56:01 UTC
Moving the window towards the bottom of the screen does not cause artefacts, interestingly enough if I move it up it leaves artefacts, then I move it down, it repaints over the remnants...

...I think I might want to change my answer about closing windows... I do get an artefact
Comment 7 Thomas Lübking 2015-12-08 14:55:32 UTC
(In reply to bluescreen_avenger from comment #6)
> Moving the window towards the bottom of the screen does not cause artefacts,

Smells like an off-by-one error or related to the titlebar ./. the border size.
What about the left edge (when moving windows rightwards)?

> interestingly enough if I move it up it leaves artefacts, then I move it
> down, it repaints over the remnants...

Clearing them or leaving them?
Comment 8 bluescreenavenger 2015-12-09 02:20:34 UTC
It leaves the artefacts moving the windows up-left 
it clears them when moving them down-right


I'm also realizing some glitches that happen when I hover over some wayland applications, such as wiggly, (it does change on over), It is in the same direction... about to attach a screenshot
Comment 9 bluescreenavenger 2015-12-09 02:21:57 UTC
Created attachment 95941 [details]
drawing glitch also goes within applications that are not moved (qt wiggly test)
Comment 10 bluescreenavenger 2015-12-09 13:13:25 UTC
Argh... Now I'm realizing it affects the qpainter backend, not just on the Framebuffer, but on the Wayland and X11 backends too
Comment 11 bluescreenavenger 2015-12-09 13:19:17 UTC
Created attachment 95950 [details]
the drawing glitches affecting qpainter in the wayland backend

This only effects when the qpainter render is being used, for the wayland (and x11 backend)

It seems qpainter also has a weird transparency issue in the xterm text going through the nested window...
It does not affect the opengl backend
Comment 12 Martin Flöser 2015-12-09 14:12:57 UTC
beautiful :-) But actually I'm glad that it's a generic issue and not just on DRM
Comment 13 Martin Flöser 2016-06-27 06:06:51 UTC
*** Bug 364720 has been marked as a duplicate of this bug. ***
Comment 14 Martin Flöser 2016-06-27 15:16:30 UTC
I started investigating the bug, and there are in fact multiple: the cursor does not get repainted when changed, the new cursor area is not considered during rendering, the damage on a window clips away the repaint of the old cursor, in non overlapped areas (background) the cursor is not repainted. Overall shows that QPainter compositor was a rather quickly written and hardly tested code base.
Comment 15 Martin Flöser 2016-06-28 06:48:45 UTC
Found the main problems and created:
* https://phabricator.kde.org/D2023
* https://phabricator.kde.org/D2024
* https://phabricator.kde.org/D2025

Now going to try to auto-test this for the virtual backend.
Comment 16 Martin Flöser 2016-06-28 10:43:21 UTC
Git commit 736d99fc6a8e0a1b09f34de6da02a0fbb83e79c3 by Martin Gräßlin.
Committed on 28/06/2016 at 10:40.
Pushed by graesslin into branch 'Plasma/5.7'.

Properly trigger repaint for sofware cursor

Summary:
When the cursor changes the old and the new cursor geometry needs to
be repainted. Also when the cursor image changes a repaint of old and
new geometry is needed.

To support this the current cursor geometry is tracked instead of just
the cursor position. From the cursor position it's not possible to get
to the cursor geometry once the cursor image or hotspot changes, thus
the complete geometry needs tracking.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2023

M  +5    -6    platform.cpp
M  +1    -1    platform.h

http://commits.kde.org/kwin/736d99fc6a8e0a1b09f34de6da02a0fbb83e79c3
Comment 17 Martin Flöser 2016-06-29 06:51:25 UTC
Git commit feadcea6cea7b74acf4896c85dcb7d577615ff42 by Martin Gräßlin.
Committed on 29/06/2016 at 06:48.
Pushed by graesslin into branch 'Plasma/5.7'.

[platforms] Call setSoftWareCursor in init instead of ctor

Summary:
Platform::setSoftWareCursor creates connections to the Cursor in order
to trigger repaints whenever the cursor position changes. The Cursor is
created before Platform::init is called, but after the Platform is
created. Thus the call needs to happen in init, otherwise the cursor
is not rendered correctly.
FIXED-IN: 5.7.0

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2025

M  +1    -1    plugins/platforms/fbdev/fb_backend.cpp
M  +1    -1    plugins/platforms/virtual/virtual_backend.cpp

http://commits.kde.org/kwin/feadcea6cea7b74acf4896c85dcb7d577615ff42
Comment 18 Martin Flöser 2016-06-29 06:51:25 UTC
Git commit fd19db0fbeae321d241c90faec4ed100c2c7037b by Martin Gräßlin.
Committed on 29/06/2016 at 06:47.
Pushed by graesslin into branch 'Plasma/5.7'.

Properly clip the damage region and windows in SceneQPainter

Summary:
On the framebuffer backend the software rendered cursor was creating
rendering artifacts due to incorrect clipping. This change ensures that
in a single screen setup the clipping is performed correctly. For multi
screen a similar change might be required, but we currently don't have
any a way to test that as framebuffer only supports one screen and other
(visual) platforms don't support the software cursor.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2024

M  +3    -4    scene_qpainter.cpp

http://commits.kde.org/kwin/fd19db0fbeae321d241c90faec4ed100c2c7037b
Comment 19 Martin Flöser 2016-06-29 17:33:30 UTC
This issue should be fixed now with the commits above. And in order to ensure that it never happens again: https://phabricator.kde.org/D2046