-def ob_focused(data):
- global ob_focus_raise
- global ob_focus_fallback
- global ob_focus_stack
- if data.client:
- window = data.client.window()
- # add/move to front the stack
- if window in ob_focus_stack:
- ob_focus_stack.remove(window)
- ob_focus_stack.insert(0, window)
- elif ob_focus_fallback:
- # pass around focus
- desktop = openbox.screen(data.screen).desktop()
- l = len(ob_focus_stack)
- i = 0
- while i < l:
- w = ob_focus_stack[i]
- client = openbox.findClient(w)
- if not client: # window is gone, remove it
- ob_focus_stack.pop(i)
- l = l - 1
- elif client.desktop() == desktop and \
- client.normal() and client.focus():
- break
- else:
- i = i + 1
+###########################################################################
+###########################################################################
+
+###########################################################################
+### Internal stuff, should not be accessed outside the module. ###
+###########################################################################
+
+import ob
+
+# maintain a list of clients, stacked in focus order
+_clients = []
+_skip = 0
+
+def _focusable(client, desktop):
+ if not client.normal(): return 0
+ if not (client.canFocus() or client.focusNotify()): return 0
+ if client.iconic(): return 0
+ if AVOID_SKIP_TASKBAR and client.skipTaskbar(): return 0
+
+ desk = client.desktop()
+ if not (desk == 0xffffffff or desk == desktop): return 0