summaryrefslogtreecommitdiff
path: root/openbox/client.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-06-04 17:16:50 +0000
committerDana Jansens <danakj@orodu.net>2003-06-04 17:16:50 +0000
commite0fa57d21c83bbfe87b15224f699bc24628fd89f (patch)
tree1f8710e396b5369453232f7c91a0c9d0b0f1ebbd /openbox/client.c
parent9232682ad64c6ee0956a748312b9ca8136434bf3 (diff)
allow focus_fallback to query if a client can be focused without changing the focus order on it
Diffstat (limited to 'openbox/client.c')
-rw-r--r--openbox/client.c20
1 files changed, 20 insertions, 0 deletions
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);