diff --git a/src/common.h b/src/common.h index 08e972a..6adbd19 100644 --- a/src/common.h +++ b/src/common.h @@ -437,22 +437,6 @@ static inline bool bkend_use_glx(session_t *ps) { return BKEND_GLX == ps->o.backend || BKEND_XR_GLX_HYBRID == ps->o.backend; } -/** - * Find out the currently focused window. - * - * @return struct win object of the found window, NULL if not found - */ -static inline struct managed_win *find_focused(session_t *ps) { - if (!ps->o.track_focus) { - return NULL; - } - - if (ps->active_win && win_is_focused_real(ps, ps->active_win)) { - return ps->active_win; - } - return NULL; -} - static void set_ignore(session_t *ps, unsigned long sequence) { if (ps->o.show_all_xerrors) return; diff --git a/src/dbus.c b/src/dbus.c index 4fd027b..07af63c 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -931,9 +931,8 @@ static bool cdbus_process_find_win(session_t *ps, DBusMessage *msg) { } // Find focused window else if (!strcmp("focused", target)) { - auto w = find_focused(ps); - if (w) { - wid = w->base.id; + if (ps->active_win && ps->active_win->state != WSTATE_UNMAPPED) { + wid = ps->active_win->base.id; } } else { log_error(CDBUS_ERROR_BADTGT_S, target);