Bug 1828070 [Wayland] Don't proceed in RequestWaylandFocusPromise() when wl_seat is missing r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D175465
This commit is contained in:
stransky 2023-04-17 08:23:16 +00:00
Родитель 70833f0c1d
Коммит 6a937b9474
1 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -296,18 +296,16 @@ static const struct xdg_activation_token_v1_listener token_listener = {
RefPtr<FocusRequestPromise> RequestWaylandFocusPromise() {
#ifdef MOZ_WAYLAND
if (!GdkIsWaylandDisplay() || !nsWindow::GetFocusedWindow() ||
nsWindow::GetFocusedWindow()->IsDestroyed()) {
if (!GdkIsWaylandDisplay() || !KeymapWrapper::GetSeat()) {
return nullptr;
}
RefPtr<nsWindow> sourceWindow = nsWindow::GetFocusedWindow();
if (!sourceWindow) {
if (!sourceWindow || sourceWindow->IsDestroyed()) {
return nullptr;
}
RefPtr<nsWaylandDisplay> display = WaylandDisplayGet();
xdg_activation_v1* xdg_activation = display->GetXdgActivation();
xdg_activation_v1* xdg_activation = WaylandDisplayGet()->GetXdgActivation();
if (!xdg_activation) {
return nullptr;
}