Commit 1d810ea
Jeronimo Garcia
fix: add dispose() methods and scale body images to prevent VRAM/GTT memory leaks
Add proper resource cleanup in dispose() methods for several widget classes
and scale body images to display size to prevent GPU memory (VRAM/GTT) leaks.
Changes:
- Notification: Add dispose() to clear img, img_app_icon, body_image and
remove pending timeouts. Also clear body_image before setting new paintable.
- Notification: Scale body images to display size instead of loading full
resolution (e.g., 2560x1440 screenshots were using ~11MB GPU memory each,
now use ~120KB when scaled to 200x100 display size).
- MprisPlayer: Add dispose() and enhance before_destroy() to cancel downloads
and clear album_art/background_picture textures. Clear textures before
loading new album art.
- Underlay: Add dispose() to properly unparent children.
- NotificationGroup: Add dispose() to skip/null animations and clear collections.
These fixes address GPU memory accumulation observed when:
- Notifications with large images (screenshots) are shown
- MPRIS players update album art frequently
- Notification groups are expanded/collapsed
The body image scaling fix provides ~100x reduction in GPU memory per image
notification containing large images like screenshots.1 parent 2083415 commit 1d810ea
4 files changed
Lines changed: 138 additions & 2 deletions
File tree
- src
- controlCenter/widgets/mpris
- notificationGroup
- notification
- underlay
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
101 | 106 | | |
102 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
103 | 115 | | |
104 | 116 | | |
105 | 117 | | |
| |||
263 | 275 | | |
264 | 276 | | |
265 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
266 | 282 | | |
267 | 283 | | |
268 | 284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
108 | 124 | | |
109 | 125 | | |
110 | 126 | | |
| |||
344 | 360 | | |
345 | 361 | | |
346 | 362 | | |
347 | | - | |
348 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
349 | 380 | | |
350 | 381 | | |
351 | 382 | | |
| |||
0 commit comments