Skip to content

Commit

Permalink
[M107] wayland: bypass xdg-activation calls during dnd sessions
Browse files Browse the repository at this point in the history
Gnome Shell xdg-activation implementation seems still buggy/unstable and
crashes were observed in Chrome's tab dragging. More specifically when
dragging a tab out and dropping it outside of any toplevel surface (eg:
on the desktop area), which is addressed in https://crrev.com/c/3913256
Besides that, more crashes were observed when, for example, on
repeatedly drags a tab in and out of its source window. Such crashes
usually bring the whole desktop session down. In order to overcome these
issues, this patches WaylandWindow::Activate to no-op while in
drag-and-drop sessions.

R=​mihlenfeldt@igalia.com

(cherry picked from commit c2f09f9)

Bug: 1366504
Test: Tested manually by repeatedly dragging Chrome tabs in and out.
Change-Id: I66fa0570c86ad666ee6ea35bd4146115bc45511c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3914262
Commit-Queue: Alexander Dunaev <adunaev@igalia.com>
Commit-Queue: Nick Yamane <nickdiego@igalia.com>
Auto-Submit: Nick Yamane <nickdiego@igalia.com>
Reviewed-by: Alexander Dunaev <adunaev@igalia.com>
Cr-Original-Commit-Position: refs/heads/main@{#1050544}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3917151
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/branch-heads/5304@{chromium#145}
Cr-Branched-From: 5d7b1fc-refs/heads/main@{#1047731}
  • Loading branch information
nickdiego authored and Chromium LUCI CQ committed Sep 24, 2022
1 parent 8f1c7d1 commit 9415cd8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,11 @@ void WaylandToplevelWindow::Activate() {
ZAURA_SURFACE_ACTIVATE_SINCE_VERSION) {
zaura_surface_activate(aura_surface_.get());
} else if (connection()->xdg_activation()) {
connection()->xdg_activation()->Activate(root_surface()->surface());
// xdg-activation implementation in some compositors is still buggy and
// Mutter crashes were observed when windows are activated during window
// dragging sessions. See https://crbug.com/1366504.
if (!connection()->IsDragInProgress())
connection()->xdg_activation()->Activate(root_surface()->surface());
} else if (gtk_surface1_) {
gtk_surface1_->RequestFocus();
}
Expand Down

0 comments on commit 9415cd8

Please sign in to comment.