Skip to content

Commit

Permalink
[linux/wayland] Introduced a workaround for the crash. [merge to M103]
Browse files Browse the repository at this point in the history
In recent versions we have got a crash (see the linked crbug) that is
unclear how to investigate.  The code has DCHECKs but apparently users
who report crashes do not have means to diagnose the issue.

This patch adds a workaround (early return of the default) so that the
browser should fall back to the default path in the situation that
caused the crash.

(cherry picked from commit 09ccc58)

Bug: 1323635
Change-Id: I1f8a0bc79cf866d9f3405c21c7c0e5b868a55bf5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3657308
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Reviewed-by: Maksim Sisov <msisov@igalia.com>
Auto-Submit: Alexander Dunaev <adunaev@igalia.com>
Commit-Queue: Alexander Dunaev <adunaev@igalia.com>
Cr-Original-Commit-Position: refs/heads/main@{#1005731}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3660303
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/branch-heads/5060@{#172}
Cr-Branched-From: b83393d-refs/heads/main@{#1002911}
  • Loading branch information
alex-voodoo authored and Chromium LUCI CQ committed May 23, 2022
1 parent dc2c86c commit 79fefc4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ui/ozone/platform/wayland/host/wayland_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,18 @@ uint32_t WaylandWindow::GetPreferredEnteredOutputId() {
auto* output_manager = connection_->wayland_output_manager();
auto* output = output_manager->GetOutput(output_id);
auto* preferred_output = output_manager->GetOutput(preferred_output_id);
// crbug.com/1323635
// The compositor may have told the surface to enter the output that the
// client is not aware of. In such an event, we cannot evaluate scales, and
// can only return the default, which means falling back to the primary
// display in the code that calls this.
// DCHECKS below are kept for trying to catch the situation in developer's
// builds and find the way to reproduce the issue.
// See crbug.com/1323635
DCHECK(output) << " output " << output_id << " not found!";
DCHECK(preferred_output)
<< " output " << preferred_output_id << " not found!";
if (!output || !preferred_output)
return 0;
if (output->scale_factor() > preferred_output->scale_factor())
preferred_output_id = output_id;
}
Expand Down

0 comments on commit 79fefc4

Please sign in to comment.