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 # ButtonPressAction *a = _posqueue[BUTTONS - 1];
13 # for (int i=BUTTONS-1; i>0;)
14 # _posqueue[i] = _posqueue[--i];
16 # a->button = e.button;
17 # a->pos.setPoint(e.x_root, e.y_root);
19 # OBClient *c = Openbox::instance->findClient(e.window);
20 # // if it's not defined, they should have clicked on the root window, so this
21 # // area would be meaningless anyways
22 # if (c) a->clientarea = c->area();
24 def def_motion_release(action, win, type, modifiers, button, xroot, yroot,
29 client = Openbox_findClient(openbox, win)
35 def def_do_motion(client, xroot, yroot):
37 dx = xroot - posqueue[0][1]
38 dy = yroot - posqueue[0][2]
39 area = posqueue[0][3] # A Rect
40 OBClient_move(client, Rect_x(area) + dx, Rect_y(area) + dy)
42 def def_do_resize(client, xroot, yroot, archor_corner):
44 dx = xroot - posqueue[0][1]
45 dy = yroot - posqueue[0][2]
46 area = posqueue[0][3] # A Rect
47 OBClient_resize(client, anchor_corner,
48 Rect_width(area) - dx, Rect_height(area) + dy)
50 def def_motion(action, win, type, modifiers, xroot, yroot, time):
51 client = Openbox_findClient(openbox, win)
54 if (type == Type_Titlebar) or (type == Type_Label):
55 def_do_move(client, xroot, yroot)
56 elif type == Type_LeftGrip:
57 def_do_resize(client, xroot, yroot, OBClient_TopRight)
58 elif type == Type_RightGrip:
59 def_do_resize(client, xroot, yroot, OBClient_TopLeft)
61 def def_enter(action, win, type, modifiers):
62 client = Openbox_findClient(openbox, win)
64 OBClient_focus(client)
66 def def_leave(action, win, type, modifiers):
67 client = Openbox_findClient(openbox, win)
71 register(Action_EnterWindow, def_enter)
72 #register(Action_LeaveWindow, def_leave)
74 register(Action_ButtonPress, def_motion_press)
75 register(Action_ButtonRelease, def_motion_release)
76 register(Action_MouseMotion, def_motion)
78 print "Loaded clientmotion.py"