forked from chromium/chromium
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ozone/wayland: do not depend on WaylandScreen on buffer scale updates
This CL fixes a segfault when a WaylandScreen is created after a WaylandWindow.. Basically, when WaylandScreen is created, it gets the list of existing outputs, which it uses to create displays. In its own turn, it also checks what WaylandWindows are on those displays and calls WaylandWindow::UpdateBufferScale. This operation also results in SetBounds to be called, which calls to PlatformWindowDelegate::GetMinimumSizeForWindow, which requires ScreenOzone instance to have PlatformScreen (WaylandScreen in this case) to be set. But as long as creation of the screen, updating buffer scale, and setting updated bounds based on new scale value happens in the same sequence of calls, ScreenOzone just doesn't have the PlatformScreen set, and it results in a crash. See the stacktrace below - #3 0x7f9c30bba4c0 (/lib/x86_64-linux-gnu/libc-2.23.so+0x354bf) #4 0x556900be4bad aura::ScreenOzone::GetPrimaryDisplay() #5 0x5568ff6aebff views::DesktopWindowTreeHostPlatform::GetRootTransform() #6 0x5568ff6af1ba views::DesktopWindowTreeHostPlatform::GetMinimumSizeForWindow() #7 0x5568faeb9aaf ui::WaylandWindow::SetBounds() #8 0x5568faeb961e ui::WaylandWindow::UpdateBufferScale() #9 0x5568faeb473d ui::WaylandScreen::AddOrUpdateDisplay() #10 0x5568faeb3023 ui::WaylandOutputManager::CreateWaylandScreen() #11 0x5568faec7fa2 ui::(anonymous namespace)::OzonePlatformWayland::CreateScreen() #12 0x556900be480a aura::ScreenOzone::ScreenOzone() #13 0x5568ff6aa10e views::DesktopScreenOzone::DesktopScreenOzone() This only happens in test environments (interactive_ui_tests, when Ozone is initialized, WaylandWindows are created, but the screen instance is created and set a bit later. Thus, make WaylandWindow use existing information about preferred outputs that it has. Bug: 1134495 Change-Id: I3f2f9349adc85684d5cf4f5e2bca8497c326bb9b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2773276 Commit-Queue: Maksim Sisov <msisov@igalia.com> Reviewed-by: Robert Kroeger <rjkroege@chromium.org> Cr-Commit-Position: refs/heads/master@{#865569}
- Loading branch information
Showing
11 changed files
with
57 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters