From d8dde72fbb99ce7912e655a5765b4f5a42256c94 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 6 Apr 2023 04:04:40 +0200 Subject: [PATCH] nixosTests.gnome: Fix tests for 44 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Launching an app externally (like we do in tests) does not dismiss the GNOME Shell’s Activities view opened on log-in. 2. Activities view grabs input so that user can type to search. 3. Due to a regression in Mutter 44, a window focus is not acquired when Shell grabs input https://gitlab.gnome.org/GNOME/mutter/-/commit/3ac82a58c51a5c8db6b49e89a1232f99c79644cc As a result, trying to determine the WMClass would throw: TypeError: global.display.focus_window is null Let’s dismiss the Activities view with Escape key as a workaround. --- nixos/tests/gnome-xorg.nix | 3 +++ nixos/tests/gnome.nix | 3 +++ 2 files changed, 6 insertions(+) diff --git a/nixos/tests/gnome-xorg.nix b/nixos/tests/gnome-xorg.nix index f520a0123830..d616d4f02351 100644 --- a/nixos/tests/gnome-xorg.nix +++ b/nixos/tests/gnome-xorg.nix @@ -82,6 +82,9 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : { ) with subtest("Open Console"): + # Close the Activities view so that Shell can correctly track the focused window. + machine.send_key("esc") + machine.succeed( "${launchConsole}" ) diff --git a/nixos/tests/gnome.nix b/nixos/tests/gnome.nix index 5ab641f9f848..5a28e3bb0e81 100644 --- a/nixos/tests/gnome.nix +++ b/nixos/tests/gnome.nix @@ -79,6 +79,9 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : { ) with subtest("Open Console"): + # Close the Activities view so that Shell can correctly track the focused window. + machine.send_key("esc") + machine.succeed( "${launchConsole}" )