shell-window-tracker: Detect invalid PID values of 0

MetaWindows get_pid() API changed to use the client PID, which also
works for Wayland clients instead of only X11 clients now. This API
returns 0 instead of -1 for invalid PIDs, so update our check according
to that.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1184
This commit is contained in:
Jonas Dreßler 2020-04-06 20:28:00 +02:00 committed by Florian Müllner
parent e8f5a842b1
commit 4aee87a31b

View File

@ -343,7 +343,7 @@ get_app_from_window_pid (ShellWindowTracker *tracker,
pid = meta_window_get_pid (window); pid = meta_window_get_pid (window);
if (pid == -1) if (pid < 1)
return NULL; return NULL;
result = shell_window_tracker_get_app_from_pid (tracker, pid); result = shell_window_tracker_get_app_from_pid (tracker, pid);