window: Use client PID for meta_window_get_pid()

The shell uses the PID of windows to map them to apps or to find out
which window/app triggered a dialog. It currently fails to do that in
some situations on Wayland, because meta_window_get_pid() only returns a
valid PID for x11 clients.

So use the client PID instead of the X11-exclusive _NET_WM_PID property
to find out the PID of the process that started the window. We can do
that by simply renaming the already existing
meta_window_get_client_pid() API to meta_window_get_pid() and moving
the old API providing the _NET_WM_PID to meta_window_get_netwm_pid().

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1180
This commit is contained in:
Jonas Dreßler
2020-04-06 13:03:49 +02:00
committed by Florian Müllner
parent 11f224f4b0
commit dac09a8e23
5 changed files with 7 additions and 24 deletions

View File

@ -95,7 +95,7 @@ meta_window_delete (MetaWindow *window,
void
meta_window_kill (MetaWindow *window)
{
pid_t pid = meta_window_get_client_pid (window);
pid_t pid = meta_window_get_pid (window);
if (pid > 0)
{