Commit 549a38d
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 549a38d
File tree
5 files changed
+94
-9
lines changed- src
- controlCenter
- widgets/mpris
- notificationGroup
- notification
- underlay
5 files changed
+94
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
383 | 385 | | |
384 | 386 | | |
385 | 387 | | |
| |||
| 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 | | |
| |||
264 | 276 | | |
265 | 277 | | |
266 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
267 | 283 | | |
268 | 284 | | |
269 | 285 | | |
| |||
| 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 | | |
| |||
309 | 325 | | |
310 | 326 | | |
311 | 327 | | |
312 | | - | |
| 328 | + | |
| 329 | + | |
313 | 330 | | |
314 | 331 | | |
315 | 332 | | |
| |||
344 | 361 | | |
345 | 362 | | |
346 | 363 | | |
347 | | - | |
348 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
349 | 381 | | |
350 | 382 | | |
351 | 383 | | |
| |||
485 | 517 | | |
486 | 518 | | |
487 | 519 | | |
488 | | - | |
| 520 | + | |
| 521 | + | |
489 | 522 | | |
490 | 523 | | |
491 | 524 | | |
| |||
505 | 538 | | |
506 | 539 | | |
507 | 540 | | |
508 | | - | |
| 541 | + | |
| 542 | + | |
509 | 543 | | |
510 | 544 | | |
511 | 545 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
210 | 228 | | |
211 | 229 | | |
212 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
36 | 51 | | |
37 | 52 | | |
38 | 53 | | |
| |||
0 commit comments