]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
allow focus_fallback to query if a client can be focused without changing the focus...
[chaz/openbox] / openbox / client.c
index 9e56de050dbdb29c371628e4b58b831f7918b0ed..40b0836e1c61276e9688fdb4c0639cf04f116596 100644 (file)
@@ -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);
 
This page took 0.023613 seconds and 4 git commands to generate.