From c6fd3aa890fd7497b12f270a03c895050d67b04e Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 4 Jun 2003 19:24:37 +0000 Subject: [PATCH] use client_can_focus from client_focus to always get the same result --- openbox/client.c | 42 +++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/openbox/client.c b/openbox/client.c index beb5c986..a9a9eb5f 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -2240,38 +2240,14 @@ Client *client_focus_target(Client *self) } gboolean client_can_focus(Client *self) -{ - /* same code as in client_focus */ - - /* choose the correct target */ - self = client_focus_target(self); - - if (!self->frame->visible) - return FALSE; - - if (!((self->can_focus || self->focus_notify) && - (self->desktop == screen_desktop || - self->desktop == DESKTOP_ALL) && - !self->iconic)) - return FALSE; - - return TRUE; -} - -gboolean client_focus(Client *self) { XEvent ev; - /* same code as in client_can_focus */ - /* choose the correct target */ self = client_focus_target(self); - if (!self->frame->visible) { - /* update the focus lists */ - focus_order_to_top(self); + if (!self->frame->visible) return FALSE; - } if (!((self->can_focus || self->focus_notify) && (self->desktop == screen_desktop || @@ -2297,6 +2273,22 @@ gboolean client_focus(Client *self) } } + return TRUE; +} + +gboolean client_focus(Client *self) +{ + /* choose the correct target */ + self = client_focus_target(self); + + if (!client_can_focus(self)) { + if (!self->frame->visible) { + /* update the focus lists */ + focus_order_to_top(self); + } + return FALSE; + } + if (self->can_focus) /* RevertToPointerRoot causes much more headache than RevertToNone, so I choose to use it always, hopefully to find errors quicker, if any -- 2.39.2