diff --git a/src/core/window-private.h b/src/core/window-private.h index d6de1256c..ed5d8059b 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -548,6 +548,8 @@ struct _MetaWindow } placement; guint unmanage_idle_id; + + pid_t client_pid; }; struct _MetaWindowClass diff --git a/src/core/window.c b/src/core/window.c index b2a7be5dd..d7faf00fc 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -1149,6 +1149,8 @@ _meta_window_shared_new (MetaDisplay *display, window->is_remote = FALSE; window->startup_id = NULL; + window->client_pid = 0; + window->xtransient_for = None; window->xclient_leader = None; @@ -7595,7 +7597,10 @@ meta_window_get_pid (MetaWindow *window) { g_return_val_if_fail (META_IS_WINDOW (window), 0); - return META_WINDOW_GET_CLASS (window)->get_client_pid (window); + if (window->client_pid == 0) + window->client_pid = META_WINDOW_GET_CLASS (window)->get_client_pid (window); + + return window->client_pid; } /**