]>
Dogcows Code - chaz/openbox/blob - scripts/focus.py
970300131051137b1690c0d01bf58c0ee629dfa2
1 ###########################################################################
2 ### Functions for helping out with your window focus. ###
3 ###########################################################################
5 ###########################################################################
6 ### Options that affect the behavior of the focus module. ###
7 ###########################################################################
9 """Don't focus windows which have requested to not be displayed in taskbars.
10 You will still be able to focus the windows, but not through cycling, and
11 they won't be focused as a fallback if 'fallback' is enabled."""
13 """Send focus somewhere when nothing is left with the focus, if possible."""
14 ###########################################################################
16 ###########################################################################
17 ###########################################################################
19 ###########################################################################
20 ### Internal stuff, should not be accessed outside the module. ###
21 ###########################################################################
25 # maintain a list of clients, stacked in focus order
29 def _focusable(client
, desktop
):
30 if not client
.normal(): return 0
31 if not (client
.canFocus() or client
.focusNotify()): return 0
32 if avoid_skip_taskbar
and client
.skipTaskbar(): return 0
34 desk
= client
.desktop()
35 if not (desk
== 0xffffffff or desk
== desktop
): return 0
45 win
= data
.client
.window()
48 _clients
.insert(0, win
)
51 desktop
= ob
.openbox
.screen(data
.screen
).desktop()
53 client
= ob
.openbox
.findClient(w
)
54 if client
and _focusable(client
, desktop
) and client
.focus():
58 _clients
.append(data
.client
.window())
60 def _closewindow(data
):
62 _clients
.remove(data
.client
.window())
63 except ValueError: pass
65 ob
.ebind(ob
.EventAction
.NewWindow
, _newwindow
)
66 ob
.ebind(ob
.EventAction
.CloseWindow
, _closewindow
)
67 ob
.ebind(ob
.EventAction
.Focus
, _focused
)
69 print "Loaded focus.py"
This page took 0.036278 seconds and 4 git commands to generate.