diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2020-03-03 12:27:43 -0500 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2020-03-03 12:27:43 -0500 |
commit | f6f4c1fcc8ced945e9f5ea9294037a98ea98ee1f (patch) | |
tree | 8bfa74854696fa6a4ecb43b5b97b92ed4ba7b247 /src/lib/efl_wl | |
parent | 146cf9da7e917d1d9e282a7378258d98610057d0 (diff) |
efl-wl: add function to get pid of a surface
Summary: this is useful for tracking surfaces of specific clients
Reviewers: bu5hm4n, devilhorns
Reviewed By: devilhorns
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11438
Diffstat (limited to 'src/lib/efl_wl')
-rw-r--r-- | src/lib/efl_wl/Efl_Wl.h | 11 | ||||
-rw-r--r-- | src/lib/efl_wl/efl_wl.c | 12 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/lib/efl_wl/Efl_Wl.h b/src/lib/efl_wl/Efl_Wl.h index 62f43e0d2b..3bf4aeea20 100644 --- a/src/lib/efl_wl/Efl_Wl.h +++ b/src/lib/efl_wl/Efl_Wl.h | |||
@@ -178,6 +178,17 @@ EAPI void *efl_wl_global_add(Evas_Object *obj, const void *interface, uint32_t v | |||
178 | EAPI Eina_Bool efl_wl_surface_extract(Evas_Object *surface); | 178 | EAPI Eina_Bool efl_wl_surface_extract(Evas_Object *surface); |
179 | 179 | ||
180 | /** | 180 | /** |
181 | * Return the pid for the surface's client | ||
182 | * | ||
183 | * Get the pid of the underlying client that created the surface. | ||
184 | * | ||
185 | * @param surface The surface to extract | ||
186 | * @return The pid of the surface, or -1 on failure | ||
187 | * @since 1.24 | ||
188 | */ | ||
189 | EAPI int32_t efl_wl_surface_pid_get(Evas_Object *surface); | ||
190 | |||
191 | /** | ||
181 | * Get the Evas_Object for an extracted wl_surface resource created by an efl_wl object | 192 | * Get the Evas_Object for an extracted wl_surface resource created by an efl_wl object |
182 | * | 193 | * |
183 | * @note Passing anything other than a valid wl_surface resource from an efl_wl object will guarantee a crash. | 194 | * @note Passing anything other than a valid wl_surface resource from an efl_wl object will guarantee a crash. |
diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index d872a4a426..4b1afa64ec 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c | |||
@@ -5909,6 +5909,18 @@ extracted_changed(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event | |||
5909 | shell_surface_send_configure(data); | 5909 | shell_surface_send_configure(data); |
5910 | } | 5910 | } |
5911 | 5911 | ||
5912 | int32_t | ||
5913 | efl_wl_surface_pid_get(Evas_Object *surface) | ||
5914 | { | ||
5915 | Comp_Surface *cs; | ||
5916 | int32_t pid; | ||
5917 | if (!eina_streq(evas_object_type_get(surface), "comp_surface")) abort(); | ||
5918 | cs = evas_object_smart_data_get(surface); | ||
5919 | EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->dead, -1); | ||
5920 | wl_client_get_credentials(wl_resource_get_client(cs->res), &pid, NULL, NULL); | ||
5921 | return pid; | ||
5922 | } | ||
5923 | |||
5912 | Eina_Bool | 5924 | Eina_Bool |
5913 | efl_wl_surface_extract(Evas_Object *surface) | 5925 | efl_wl_surface_extract(Evas_Object *surface) |
5914 | { | 5926 | { |