]> Dogcows Code - chaz/openbox/blobdiff - scripts/clicks.py
add some globals to modify the default scripting behavior
[chaz/openbox] / scripts / clicks.py
index 3c958bf4828fdb0a08a5172f533e6a1c77e603e1..91429d1ff725a3db10b66f21d713c7b3c894aa12 100644 (file)
@@ -18,17 +18,24 @@ def def_click_client(action, win, type, modifiers, button, time):
                elif button == Button5:
                        print "OBClient_unshade(client)"
 
-def def_click_model(action, win, type, modifiers, button, time):
+def def_press_model(action, win, type, modifiers, button, xroot, yroot, time):
        if button != Button1: return
        client = Openbox_findClient(openbox, win)
-       if not client: return
-       print "OBClient_focus(client)"
+       if not client or (type == Type_StickyButton or
+                         type == Type_IconifyButton or
+                         type == Type_MaximizeButton or
+                         type == Type_CloseButton):
+               return
+       if click_focus != 0:
+               OBClient_focus(client)
        print "OBClient_raise(client)"
 
 def def_click_root(action, win, type, modifiers, button, time):
        if type == Type_Root:
                if button == Button1:
                        print "nothing probly.."
+                       client = Openbox_focusedClient(openbox)
+                       if client: OBClient_unfocus(client)
                elif button == Button2:
                        print "workspace menu"
                elif button == Button3:
@@ -46,7 +53,7 @@ def def_doubleclick_client(action, win, type, modifiers, button, time):
                print "OBClient_toggleshade(client)"
 
 
-register(Action_Click, def_click_model)
+preregister(Action_ButtonPress, def_press_model)
 register(Action_Click, def_click_client)
 register(Action_Click, def_click_root)
 register(Action_DoubleClick, def_doubleclick_client)
This page took 0.020951 seconds and 4 git commands to generate.