Accessors for pid and name of client machine associated with MetaWindow

http://bugzilla.gnome.org/show_bug.cgi?id=590388
This commit is contained in:
Tomas Frydrych 2009-07-31 18:52:25 +01:00
parent 8f9a174f0a
commit 8b7b41df41
2 changed files with 39 additions and 1 deletions

View File

@ -8668,3 +8668,40 @@ meta_window_get_transient_for (MetaWindow *window)
else
return NULL;
}
/**
* meta_window_get_pid:
* @window: a #MetaWindow
*
* Returns pid of the process that created this window, if known (obtained from
* the _NET_WM_PID property).
*
* Return value: (transfer none): the pid, or -1 if not known.
*/
int
meta_window_get_pid (MetaWindow *window)
{
g_return_val_if_fail (META_IS_WINDOW (window), -1);
return window->net_wm_pid;
}
/**
* meta_window_get_client_machine:
* @window: a #MetaWindow
*
* Returns name of the client machine from which this windows was created,
* if known (obtained from the WM_CLIENT_MACHINE property).
*
* Return value: (transfer none): the machine name, or NULL; the string is
* owned by the window manager and should not be freed or modified by the
* caller.
*/
const char *
meta_window_get_client_machine (MetaWindow *window)
{
g_return_val_if_fail (META_IS_WINDOW (window), NULL);
return window->wm_client_machine;
}

View File

@ -112,5 +112,6 @@ const char *meta_window_get_title (MetaWindow *window);
MetaWindow *meta_window_get_transient_for (MetaWindow *window);
void meta_window_delete (MetaWindow *window,
guint32 timestamp);
int meta_window_get_pid (MetaWindow *window);
const char *meta_window_get_client_machine (MetaWindow *window);
#endif