Bug 462399 - [CRASH/LOCKUP] ScrollView in notification applet causes freeze when popup is sized exactly right to oscillate between scrollable and non-scrollable states
Summary: [CRASH/LOCKUP] ScrollView in notification applet causes freeze when popup is ...
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Notifications (show other bugs)
Version: master
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-29 15:35 UTC by Naxdy
Modified: 2023-04-28 16:41 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
demo of the bug (2.41 MB, video/mp4)
2022-11-29 15:35 UTC, Naxdy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Naxdy 2022-11-29 15:35:31 UTC
Created attachment 154140 [details]
demo of the bug

SUMMARY

Since the ScrollBar component does not occupy any physical space when hidden, notifications occupy a little more space. Conversely, when the ScrollBar is visible, notifications get shrunk down by a bit.

Although this is intended behavior, this causes the component to enter an infinite loop whenever the notification applet is at a certain size where notifications without a ScrollBar occupy enough space to warrant a ScrollBar, but once the ScrollBar is present, shrink down to a size to where it's no longer needed.

We then rapidly go back and forth between big(ger) notifs and no ScrollBar (but overflow) and smal(ler) notifs and a ScrollBar (but no overflow), causing the entire plasmashell to lock up.


STEPS TO REPRODUCE
0. Clear your notification history
1. Take two screenshots with spectacle
2. Open the notification applet twice (so that the "show more" button is visible)
3. Open the notification history
4. Slowly increase its vertical size

OBSERVED RESULT
Plasmashell locks up and becomes entirely unresponsive


EXPECTED RESULT
Plasmashell does NOT lock up
Comment 1 Nate Graham 2023-04-27 23:37:58 UTC
The scrollview has been changed a lot for Plasma 5.27; can you try again with that release?
Comment 2 Naxdy 2023-04-27 23:41:42 UTC
Yep, still happens. The problem is that some notification elements (like images, e.g. when taking a screenshot) change their vertical size in conjunction with their horizontal size.

Images are easy to use as an example: If an image is supposed to preserve its aspect ratio, it will also shrink vertically if it is supposed to shrink horizontally (-> due to scrollbar appearing). Now, the notification is no longer too tall for the view, and the scrollbar is not needed. The image now expands horizontally since the scrollbar is gone, which also causes it to expand vertically (thus requiring a scrollbar again), and this dance continues ad infinitum.
Comment 3 Nate Graham 2023-04-28 16:41:40 UTC
Ah that makes sense. Can reproduce that.