From 2f7b359183a2dd7631c669583d0038fe840bc929 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 26 Sep 2019 11:23:12 -0400 Subject: [PATCH] ecore-x: add internal function for selecting just properties of root window Summary: this is just a shortcut for watching properties in the case where no wm is active in the process Depends on D10012 Reviewers: devilhorns Reviewed By: devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10013 --- src/lib/ecore_x/ecore_x.c | 11 +++++++++++ src/lib/ecore_x/ecore_x_private.h | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/lib/ecore_x/ecore_x.c b/src/lib/ecore_x/ecore_x.c index 8503addacd..924b416ebb 100644 --- a/src/lib/ecore_x/ecore_x.c +++ b/src/lib/ecore_x/ecore_x.c @@ -1431,6 +1431,17 @@ ecore_x_window_sniff(Ecore_X_Window win) if (_ecore_xlib_sync) ecore_x_sync(); } +/* this is internal-only for now */ +EAPI void +ecore_x_window_root_properties_select(void) +{ + LOGFN(__FILE__, __LINE__, __FUNCTION__); + if (_ecore_x_window_manage_succeeded) return; + EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp); + XSelectInput(_ecore_x_disp, ecore_x_window_root_first_get(), PropertyChangeMask); + if (_ecore_xlib_sync) ecore_x_sync(); +} + EAPI void ecore_x_window_client_sniff(Ecore_X_Window win) { diff --git a/src/lib/ecore_x/ecore_x_private.h b/src/lib/ecore_x/ecore_x_private.h index 7374a0d9ee..ce81efe3d6 100644 --- a/src/lib/ecore_x/ecore_x_private.h +++ b/src/lib/ecore_x/ecore_x_private.h @@ -406,4 +406,24 @@ int _ecore_x_shutdown(void); #define LOGFN(fl, ln, fn) #endif /* ifdef LOGFNS */ + + +#ifdef EAPI +# undef EAPI +#endif // ifdef EAPI + +#ifdef __GNUC__ +# if __GNUC__ >= 4 +# define EAPI __attribute__ ((visibility("default"))) +# else // if __GNUC__ >= 4 +# define EAPI +# endif // if __GNUC__ >= 4 +#else // ifdef __GNUC__ +# define EAPI +#endif // ifdef __GNUC__ +EAPI void ecore_x_window_root_properties_select(void); +#undef EAPI +#define EAPI + + #endif /* ifndef _ECORE_X_PRIVATE_H */