From 4d90e73415f711ac89f6658059874283d37bd63b Mon Sep 17 00:00:00 2001 From: devilhorns Date: Mon, 8 Aug 2011 18:05:46 +0000 Subject: [PATCH] Ecore_X: Fix newly added xfixes selection code for Tom ;) git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@62210 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore_x/xcb/ecore_xcb_xfixes.c | 37 ++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/src/lib/ecore_x/xcb/ecore_xcb_xfixes.c b/src/lib/ecore_x/xcb/ecore_xcb_xfixes.c index 46e62d3..e902046 100644 --- a/src/lib/ecore_x/xcb/ecore_xcb_xfixes.c +++ b/src/lib/ecore_x/xcb/ecore_xcb_xfixes.c @@ -47,10 +47,7 @@ _ecore_xcb_xfixes_finalize(void) if (reply) { if (reply->major_version >= 3) - { - _xfixes_avail = EINA_TRUE; - ECORE_X_EVENT_FIXES_SELECTION_NOTIFY = ecore_event_type_new(); - } + _xfixes_avail = EINA_TRUE; free(reply); } @@ -64,17 +61,31 @@ EAPI Eina_Bool ecore_x_fixes_selection_notification_request(Ecore_X_Atom selection) { #ifdef ECORE_XCB_XFIXES - if (_xfixes_avail) + Ecore_X_Window root = 0; + xcb_void_cookie_t cookie; + xcb_generic_error_t *err; + int mask = 0; +#endif + + if (!_xfixes_avail) return EINA_FALSE; +#ifdef ECORE_XCB_XFIXES + root = ((xcb_screen_t *)_ecore_xcb_screen)->root; + + mask = (XCB_XFIXES_SELECTION_EVENT_MASK_SET_SELECTION_OWNER | + XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_WINDOW_DESTROY | + XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_CLIENT_CLOSE); + + cookie = + xcb_xfixes_select_selection_input_checked(_ecore_xcb_conn, root, + selection, mask); + err = xcb_request_check(_ecore_xcb_conn, cookie); + if (err) { - xcb_xfixes_select_selection_input_checked(_ecore_xcb_conn, - /* FIXME: We need a way to know the root window. */ - NULL, - selection, - XCB_XFIXES_SELECTION_EVENT_MASK_SET_SELECTION_OWNER | - XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_WINDOW_DESTROY | - XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_CLIENT_CLOSE); - return EINA_TRUE; + free(err); + return EINA_FALSE; } + + return EINA_TRUE; #endif return EINA_FALSE; } -- 2.7.4