From 2dc90e7d4da36db8985ae57475395124296bcebf Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 3 Oct 2018 14:17:08 +0200 Subject: [PATCH] Convert XGetInputFocus to XCB Signed-off-by: Uli Schlachter --- src/compton.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/compton.c b/src/compton.c index 2ca970c4..c6a8aed9 100644 --- a/src/compton.c +++ b/src/compton.c @@ -870,10 +870,15 @@ recheck_focus(session_t *ps) { // Determine the currently focused window so we can apply appropriate // opacity on it - Window wid = 0; - int revert_to; + xcb_connection_t *c = XGetXCBConnection(ps->dpy); + xcb_window_t wid = XCB_NONE; + xcb_get_input_focus_reply_t *reply = + xcb_get_input_focus_reply(c, xcb_get_input_focus(c), NULL); - XGetInputFocus(ps->dpy, &wid, &revert_to); + if (reply) { + wid = reply->focus; + free(reply); + } win *w = find_win_all(ps, wid);