X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Fclient.c;h=40b0836e1c61276e9688fdb4c0639cf04f116596;hb=e0fa57d21c83bbfe87b15224f699bc24628fd89f;hp=9e56de050dbdb29c371628e4b58b831f7918b0ed;hpb=70a34967d654a957081c18b0da13944ac8af652a;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 9e56de05..40b0836e 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -2239,10 +2239,30 @@ Client *client_focus_target(Client *self) return 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);