[metacity] window-props: use meta_window_get_client_pid
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] window-props: use meta_window_get_client_pid
- Date: Sat, 12 Sep 2020 12:19:04 +0000 (UTC)
commit 8430e8436cb6bac732c00de5b5a3c3d73be62871
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sat Sep 12 14:33:15 2020 +0300
window-props: use meta_window_get_client_pid
src/core/window-props.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/src/core/window-props.c b/src/core/window-props.c
index a49821f0..1f241b4e 100644
--- a/src/core/window-props.c
+++ b/src/core/window-props.c
@@ -618,21 +618,24 @@ set_title_text (MetaWindow *window,
title, window->wm_client_machine);
modified = TRUE;
}
- else if (window->net_wm_pid != -1)
+ else if (meta_window_get_client_pid (window) != -1)
{
+ pid_t client_pid;
+ uid_t window_owner;
+ gboolean window_owner_known;
+ gboolean window_owner_is_us;
+
/* We know the process which owns this window; perhaps we can
* find out the name of its owner (if it's not us).
*/
- char *found_name = NULL;
+ client_pid = meta_window_get_client_pid (window);
+ window_owner = 0;
- uid_t window_owner = 0;
- gboolean window_owner_known =
- owner_of_process (window->net_wm_pid, &window_owner);
+ window_owner_known = owner_of_process (client_pid, &window_owner);
/* Assume a window with unknown ownership is ours (call it usufruct!) */
- gboolean window_owner_is_us =
- !window_owner_known || window_owner==getuid ();
+ window_owner_is_us = !window_owner_known || window_owner==getuid ();
if (window_owner_is_us)
{
@@ -653,6 +656,7 @@ set_title_text (MetaWindow *window,
{
/* Okay, let's look up the name. */
struct passwd *pwd;
+ char *found_name = NULL;
errno = 0;
pwd = getpwuid (window_owner);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]