window tracker: Adapt to renamed function

Ideally, the use case we have for MetaGroup would be removed but that
requires investigation that could be done as a future step

The function also expects a MetaWindowX11, so add a check to ensure
we don't crash at runtime if the function gets called on a wayland
client

Also removes an unused header import

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3157>
This commit is contained in:
Bilal Elmoussaoui 2024-01-31 16:12:59 +01:00
parent 7b5da30f21
commit 2dc0f48a22
2 changed files with 2 additions and 3 deletions

View File

@ -10,7 +10,6 @@
#include <glib.h> #include <glib.h>
#include <gio/gio.h> #include <gio/gio.h>
#include <meta/display.h> #include <meta/display.h>
#include <meta/group.h>
#include <meta/window.h> #include <meta/window.h>
#include "shell-app-usage.h" #include "shell-app-usage.h"

View File

@ -313,7 +313,7 @@ get_app_from_window_group (ShellWindowTracker *tracker,
MetaGroup *group; MetaGroup *group;
GSList *iter; GSList *iter;
group = meta_window_get_group (window); group = meta_window_x11_get_group (window);
if (group == NULL) if (group == NULL)
return NULL; return NULL;
@ -463,7 +463,7 @@ get_app_for_window (ShellWindowTracker *tracker,
/* If we didn't get a startup-notification match, see if we matched /* If we didn't get a startup-notification match, see if we matched
* any other windows in the group. * any other windows in the group.
*/ */
if (result == NULL) if (result == NULL && meta_window_get_client_type (window) == META_WINDOW_CLIENT_TYPE_X11)
result = get_app_from_window_group (tracker, window); result = get_app_from_window_group (tracker, window);
/* Our last resort - we create a fake app from the window */ /* Our last resort - we create a fake app from the window */