From a8cb23a21a65bca28203ef79f931a4a8348ecba7 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Sun, 12 Jan 2020 17:36:48 +0100 Subject: [PATCH] ecore_x: add API to request selection changed events for diff. wins we need that in order to get seleciton per window events, which is required to get a nice mapping onto the ecore_evas object. Differential Revision: https://phab.enlightenment.org/D11193 --- src/lib/ecore_x/Ecore_X.h | 8 ++++++++ src/lib/ecore_x/ecore_x_fixes.c | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/lib/ecore_x/Ecore_X.h b/src/lib/ecore_x/Ecore_X.h index bb5aedf39e..45e208e4e0 100644 --- a/src/lib/ecore_x/Ecore_X.h +++ b/src/lib/ecore_x/Ecore_X.h @@ -2444,6 +2444,14 @@ EAPI void ecore_x_root_screen_barriers_set(Ecore_X_Rectangle *scre */ EAPI Eina_Bool ecore_x_fixes_selection_notification_request(Ecore_X_Atom selection); +/** + * xfixes selection notification request. + * + * In addition to ecore_x_fixes_selection_notification_request you can also specify for which window you want to get them + */ +EAPI Eina_Bool ecore_x_fixes_window_selection_notification_request(Ecore_X_Window window, Ecore_X_Atom selection); + + /* XComposite Extension Support */ EAPI Eina_Bool ecore_x_composite_query(void); EAPI void ecore_x_composite_redirect_window(Ecore_X_Window win, Ecore_X_Composite_Update_Type type); diff --git a/src/lib/ecore_x/ecore_x_fixes.c b/src/lib/ecore_x/ecore_x_fixes.c index 5582c3e3ef..4b659c2d8b 100644 --- a/src/lib/ecore_x/ecore_x_fixes.c +++ b/src/lib/ecore_x/ecore_x_fixes.c @@ -112,6 +112,26 @@ ecore_x_fixes_selection_notification_request(Ecore_X_Atom selection) return EINA_FALSE; } +EAPI Eina_Bool +ecore_x_fixes_window_selection_notification_request(Ecore_X_Window window, Ecore_X_Atom selection) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, EINA_FALSE); + +#ifdef ECORE_XFIXES + if (_fixes_available) + { + XFixesSelectSelectionInput (_ecore_x_disp, + window, + selection, + XFixesSetSelectionOwnerNotifyMask | + XFixesSelectionWindowDestroyNotifyMask | + XFixesSelectionClientCloseNotifyMask); + return EINA_TRUE; + } +#endif + return EINA_FALSE; +} + EAPI Ecore_X_Region ecore_x_region_new(Ecore_X_Rectangle *rects, int num)