all repos — openbox @ c6fd3aa890fd7497b12f270a03c895050d67b04e

openbox fork - make it a bit more like ryudo

use client_can_focus from client_focus to always get the same result
Dana Jansens danakj@orodu.net
commit

c6fd3aa890fd7497b12f270a03c895050d67b04e

parent

4cb48bebb5e13224c0f272809914de679cf395e1

1 files changed, 17 insertions(+), 25 deletions(-)

jump to
M openbox/client.copenbox/client.c

@@ -2241,37 +2241,13 @@ }

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 ||

@@ -2295,6 +2271,22 @@ } else {

XPutBackEvent(ob_display, &ev); return FALSE; } + } + + 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)