3 def def_motion_press(action, win, type, modifiers, button, xroot, yroot, time):
4 client = Openbox_findClient(openbox, win)
7 newi = [button, xroot, yroot]
9 newi.append(new_Rect(OBClient_area(client)))
12 def def_motion_release(action, win, type, modifiers, button, xroot, yroot,
17 client = Openbox_findClient(openbox, win)
23 def def_do_motion(client, xroot, yroot):
25 dx = xroot - posqueue[0][1]
26 dy = yroot - posqueue[0][2]
27 area = posqueue[0][3] # A Rect
28 OBClient_move(client, Rect_x(area) + dx, Rect_y(area) + dy)
30 def def_do_resize(client, xroot, yroot, archor_corner):
32 dx = xroot - posqueue[0][1]
33 dy = yroot - posqueue[0][2]
34 area = posqueue[0][3] # A Rect
35 OBClient_resize(client, anchor_corner,
36 Rect_width(area) - dx, Rect_height(area) + dy)
38 def def_motion(action, win, type, modifiers, xroot, yroot, time):
39 client = Openbox_findClient(openbox, win)
42 if (type == Type_Titlebar) or (type == Type_Label):
43 def_do_motion(client, xroot, yroot)
44 elif type == Type_LeftGrip:
45 def_do_resize(client, xroot, yroot, OBClient_TopRight)
46 elif type == Type_RightGrip:
47 def_do_resize(client, xroot, yroot, OBClient_TopLeft)
49 def def_enter(action, win, type, modifiers):
50 client = Openbox_findClient(openbox, win)
53 OBClient_focus(client)
55 def def_leave(action, win, type, modifiers):
56 client = Openbox_findClient(openbox, win)
58 if leave_unfocus != 0:
59 OBClient_unfocus(client)
62 register(Action_EnterWindow, def_enter)
63 register(Action_LeaveWindow, def_leave)
65 register(Action_ButtonPress, def_motion_press)
66 register(Action_ButtonRelease, def_motion_release)
67 register(Action_MouseMotion, def_motion)
69 print "Loaded clientmotion.py"