Fix crash displaying the Preview window in multiple windows (fix #4864)

We were using a backLayer with a nullptr surface.
This commit is contained in:
David Capello 2024-12-04 15:33:01 -03:00
parent c6a1a6868a
commit 2e13559bbb
2 changed files with 4 additions and 1 deletions

View File

@ -44,6 +44,9 @@ Display::Display(Display* parentDisplay,
m_containedWidget->type() == kWindowWidget);
#endif
m_dirtyRegion = bounds();
// Configure the back layer surface.
configureBackLayer();
}
os::SurfaceRef Display::nativeSurface() const

View File

@ -353,7 +353,7 @@ void View::onSetViewScroll(const gfx::Point& pt)
// scrolled region (which is inverse to the scroll position
// delta/movement).
const Point delta = oldScroll - newScroll;
if (!display->nativeWindow()->gpuAcceleration()) {
if (display && !display->nativeWindow()->gpuAcceleration()) {
// The movable region includes the given "validRegion"
// intersecting itself when it's in the new position, so we don't
// overlap regions outside the "validRegion".