# The software has a brief white screen when recovering from minimization

**URL:** <https://discourse.slicer.org/t/the-software-has-a-brief-white-screen-when-recovering-from-minimization/31820>\
**Category:** Support\
**Created:** [September 21, 2023, 3:19am UTC](https://discourse.slicer.org/t/the-software-has-a-brief-white-screen-when-recovering-from-minimization/31820 "2023-09-21T03:19:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![slicer365](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/slicer365/32/67549_2.png) [@slicer365](https://discourse.slicer.org/u/slicer365)\
**Post date:** [September 21, 2023, 3:19am UTC](https://discourse.slicer.org/t/the-software-has-a-brief-white-screen-when-recovering-from-minimization/31820/1 "2023-09-21T03:19:24Z")

</div>

[https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/6/56ad47dc7fa1ee1df1d77f88158a2fdaeaa4ec6f.mp4](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/6/56ad47dc7fa1ee1df1d77f88158a2fdaeaa4ec6f.mp4)

When I open the histogram display, the program will show a white screen when it recovers from the minimized state.  
When I turned off the real-time update of the histogram in the source code, it didn’t work.  
May I ask how this problem can be solved?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [September 21, 2023, 3:07pm UTC](https://discourse.slicer.org/t/the-software-has-a-brief-white-screen-when-recovering-from-minimization/31820/2 "2023-09-21T15:07:06Z")

</div>

Thanks for reporting. I could reproduce this behavior on my computer, too.

When you restore the window from minimized state then the histogram is recomputed (in `qSlicerScalarVolumeDisplayWidget::showEvent(...)`). This may take a little time and maybe it also invalidates some screen buffers, which makes the operating system show a blank window during the window restore animation.

The histogram is recomputed when the widget gets shown because the histogram updates are blocked when when the histogram widget is not visible (otherwise there would be a lot of unnecessary computations when images are continuously streamed into Slicer at a high framerate). So, this histogram recomputation cannot be simply removed, but the logic could be more sophisticated: we could compare the last update time of the histogram and and the last update time of the input image data and if we find that the histogram is more recent than the image then the update could be skipped.

This is a very small cosmetic issue, and a fix is not likely to be needed for any of the funded projects, so I’m not sure if any Slicer developers would work on this right away. However, you can [submit a feature request](https://issues.slicer.org) to keep track of it and wait for it to be fixed; or if it’s more urgent then you can provide development resources (e.g., implement it yourself and send a pull request, or fund some developers to work on it).

---

<div class="post-metadata">

**Author:** ![slicer365](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/slicer365/32/67549_2.png) [@slicer365](https://discourse.slicer.org/u/slicer365)\
**Post date:** [September 21, 2023, 3:41pm UTC](https://discourse.slicer.org/t/the-software-has-a-brief-white-screen-when-recovering-from-minimization/31820/3 "2023-09-21T15:41:38Z")

</div>

Thank you for your advice, Mr Lasso.

Present, we temporarily commented on the code " this-\>updateHIstogram()"

It works well!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [September 21, 2023, 8:31pm UTC](https://discourse.slicer.org/t/the-software-has-a-brief-white-screen-when-recovering-from-minimization/31820/4 "2023-09-21T20:31:58Z")

</div>

By removing the update, the histogram may show the previously selected volume’s histogram. I would recommend to implement the logic that checks if you need to update the histogram and only skip the update if it is safe to do so.
