Summary: | Resizing apps results in flickering or controls jumping around | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | postix <postix> |
Component: | core | Assignee: | Vlad Zahorodnii <vlad.zahorodnii> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bugseforuns, michal.dybczak, nate, plasma-bugs, postix |
Priority: | NOR | Flags: | vlad.zahorodnii:
Wayland-
vlad.zahorodnii: X11+ vlad.zahorodnii: ReviewRequest+ |
Version: | 5.17.90 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
URL: | https://phabricator.kde.org/D26914 | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=417719 | ||
Latest Commit: | https://commits.kde.org/kwin/56d5f3a4f61ce00a1abc4d3c315dcbe15c22efdb | Version Fixed In: | 5.18.0 |
Attachments: |
Screenrecording of the Systemsettings being resized.
Screenrecording of Dolphin being resized. Screenrecording of the Systemsettings being resized. Screenrecording of Dolphin being resized. An example of a bad window pixmap Potential fix Screenrecording after applying the patch. Screenrecording before applying the patch. Screenrecording after applying the patch of D26914. Screenshot of a black part. Still present in 5.18.0 |
Created attachment 124869 [details]
Screenrecording of Dolphin being resized.
Created attachment 124870 [details]
Screenrecording of the Systemsettings being resized.
x264 version instead of x265 for compatibility reasons.
Created attachment 124871 [details]
Screenrecording of Dolphin being resized.
x264 instead of x265 for compatibility reasons.
*** Bug 413744 has been marked as a duplicate of this bug. *** Heh, I was looking into this issue just a few days ago and so far it seems like kwin gets bad window pixmaps. Not sure why. Perhaps we've messed up somewhere with synchronization or maybe clients are doing weird things... Created attachment 125172 [details]
An example of a bad window pixmap
Client-side drop-shadow is cut off on the right border.
Created attachment 125382 [details]
Potential fix
I would be very grateful if someone could test my patch.
(In reply to Vlad Zahorodnii from comment #7) > Created attachment 125382 [details] > Potential fix > > I would be very grateful if someone could test my patch. If you can tell what and how I can compile it, I may give it a try. :) You would have to download 5.18 tarball and apply the patch to it, then usual cmake and make sequence. You can run bin/kwin_x11 from build directory after that, no need to run make install. (In reply to Vlad Zahorodnii from comment #9) > You would have to download 5.18 tarball and apply the patch to it, then > usual cmake and make sequence. You can run bin/kwin_x11 from build directory > after that, no need to run make install. I compiled and build it successfully, but when I try to start it it says: > ./bin/kwin_x11 > FATAL ERROR: could not instantiate the platform plugin Any idea? ;) Urgh, kwin is not able to find the x11 platform plugin. I guess you could run make install (make sure that you've provided right CMAKE_INSTALL_PREFIX to the cmake command) and after you're done testing re-install kwin package (sudo pacman -Sy kwin), it will be much faster than trying to figure out why we can't locate the right plugin. Created attachment 125403 [details] Screenrecording after applying the patch. (In reply to Vlad Zahorodnii from comment #11) > Urgh, kwin is not able to find the x11 platform plugin. I guess you could > run make install (make sure that you've provided right CMAKE_INSTALL_PREFIX > to the cmake command) and after you're done testing re-install kwin package > (sudo pacman -Sy kwin), it will be much faster than trying to figure out why > we can't locate the right plugin. I tested it in a virtual machine and the result is way better than before! Thanks! :) Only a tiny remark: When I resize the kinfocenter window, you can see the systemsettings window in the background to wobble a little bit. I'm not sure if this is an effect of the graphics driver stuff in the virtual machine or if it were there before or if it comes from your patch. ;) Two more notes: * The text of the Systemsettings still shakes a little when the window becomes resized. * There was once a short case in the screen recording above where part of the system setting's window turned black for a glimpse while resizing. (In reply to Postix from comment #12) > Only a tiny remark: When I resize the kinfocenter window, you can see the > systemsettings window in the background to wobble a little bit. I'm not sure > if this is an effect of the graphics driver stuff in the virtual machine or > if it were there before or if it comes from your patch. ;) Please check whether text shakes even without my patch, it is quite important. (In reply to Postix from comment #13) > * There was once a short case in the screen recording above where part of > the system setting's window turned black for a glimpse while resizing. Most likely because it took too long for System Settings to repaint its contents. Also, please use the most recent version of the patch. (In reply to Vlad Zahorodnii from comment #14) > (In reply to Postix from comment #12) > > Only a tiny remark: When I resize the kinfocenter window, you can see the > > systemsettings window in the background to wobble a little bit. I'm not sure > > if this is an effect of the graphics driver stuff in the virtual machine or > > if it were there before or if it comes from your patch. ;) > Please check whether text shakes even without my patch, it is quite > important. I guessed so, that's why (In reply to Vlad Zahorodnii from comment #16) > Also, please use the most recent version of the patch. Is this https://bugs.kde.org/attachment.cgi?id=125382 the most recent one? (In reply to Vlad Zahorodnii from comment #16) > Also, please use the most recent version of the patch. I guess it's the diff from phabricator. I will check it out later! Created attachment 125404 [details]
Screenrecording before applying the patch.
Just for reference, here's a screen recording before applying the patch. The shaking of the text of the systemsettings in the background appears here as well if you look closely.
(In reply to Postix from comment #18) > I guess it's the diff from phabricator. I will check it out later! Yes, that one. (In reply to Postix from comment #19) > Just for reference, here's a screen recording before applying the patch. The > shaking of the text of the systemsettings in the background appears here as > well if you look closely. Oh, that's "great!" Created attachment 125407 [details]
Screenrecording after applying the patch of D26914.
Here's the recording of the latest patch.
* For the KInfocenter you see a tearing between the window title bar and the window itself
* If the KInfocenter is resized in front of the KSystemsettings there's a lot of tearing and wobbling in the Systemsettings
* Sometimes there are still frames missing where the window turns black while resizing
You may notice more if you look at the recording.
(In reply to Postix from comment #21) > * If the KInfocenter is resized in front of the KSystemsettings there's a > lot of tearing and wobbling in the Systemsettings It seems to be unrelated. > * Sometimes there are still frames missing where the window turns black > while resizing Are those frames completely black? or only some parts? Created attachment 125412 [details] Screenshot of a black part. (In reply to Vlad Zahorodnii from comment #22) > > * Sometimes there are still frames missing where the window turns black > > while resizing > Are those frames completely black? or only some parts? Only some parts as in the screenshot -- but as I just noticed, this was already the case before the patch. ;) So the patch neither made it worse nor better. Vlad, I hope you target 5.18? :) Depends on how the code review will go. Git commit 56d5f3a4f61ce00a1abc4d3c315dcbe15c22efdb by Vlad Zahorodnii. Committed on 03/02/2020 at 11:56. Pushed by vladz into branch 'Plasma/5.18'. [x11] Fix visual artifacts during interactive resize Summary: When a window is being interactively resized, its contents may jump. The reason why that happens is because KWin renders partially resized client window. Composite extension spec says that a window will get a new pixmap each time it is resized or mapped. This applies to the frame window, but not to the client window itself. If the client window is resized, off-screen storage for the frame window won't be reallocated. Therefore, KWin may render partially resized client window if the client doesn't attempt to be in sync with our rendering loop. Currently, the only way to do that is to use extended frame counters, which are not supported by KWin. So, in order to fix visual artifacts during interactive resize, we need somehow forcefully re-allocate off-screen storage for the frame window. Unfortunately, Composite extension doesn't provide any request to do that, so the only option we have is to resize the frame window. FIXED-IN: 5.18.0 Reviewers: #kwin Subscribers: davidedmundson, ngraham, alexde, fredrik, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D26914 M +11 -1 scene.cpp M +2 -1 scene.h M +1 -1 toplevel.cpp M +39 -13 x11client.cpp M +2 -0 x11client.h https://commits.kde.org/kwin/56d5f3a4f61ce00a1abc4d3c315dcbe15c22efdb *** Bug 417637 has been marked as a duplicate of this bug. *** *** Bug 417719 has been marked as a duplicate of this bug. *** Created attachment 126107 [details]
Still present in 5.18.0
This isn't fixed. This is how it looks on Plasma 5.18.0
This bugfix primarily improved the behavior for QWidgets apps, AFAIK. QML apps will need other fixes, as I understand it. (In reply to Michał Dybczak from comment #29) > This isn't fixed. This is how it looks on Plasma 5.18.0 This issue can't be really fixed on X11. We can only work around some cases. If an application uses a graphics API such as OpenGL or Vulkan to draw user interface, then the client contents may still be rendered unsynchronized. For what it's worth, one of the reasons why we have "resize" effect is because resizing windows on X11 is lame. I also would like to point out that such visual artifacts can't be seen on Wayland because "each frame is perfect." *** Bug 417637 has been marked as a duplicate of this bug. *** |
Created attachment 124868 [details] Screenrecording of the Systemsettings being resized. If you resize an app like Dolphin or the Systemsettings, the control positions are updated frequently resulting in an annoying hopping and flickering like in the two sample screen recordings. I can't remember to have seen such flickering on other systems like Windows. SOFTWARE/OS VERSIONS Operating System: Manjaro Linux KDE Plasma Version: 5.17.4 KDE Frameworks Version: 5.66.0 Qt Version: 5.14.0 Kernel Version: 5.4.7-1-MANJARO