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,
33 # ButtonPressAction *a = 0;
34 # for (int i=0; i<BUTTONS; ++i) {
35 # if (_posqueue[i]->button == e.button)
37 # if (a) // found one and removed it
38 # _posqueue[i] = _posqueue[i+1];
40 # if (a) { // found one
41 # _posqueue[BUTTONS-1] = a;
46 def def_motion(action, win, type, modifiers, xroot, yroot, time):
47 client = Openbox_findClient(openbox, win)
50 dx = xroot - posqueue[0][1]
51 dy = yroot - posqueue[0][2]
52 # _dx = x_root - _posqueue[0]->pos.x();
53 # _dy = y_root - _posqueue[0]->pos.y();
57 area = posqueue[0][3] # A Rect
58 if (type == Type_Titlebar) or (type == Type_Label):
59 OBClient_move(client, Rect_x(area) + dx, Rect_y(area) + dy)
60 # c->move(_posqueue[0]->clientarea.x() + _dx,
61 # _posqueue[0]->clientarea.y() + _dy);
62 elif type == Type_LeftGrip:
63 OBClient_resize(client, OBClient_TopRight,
64 Rect_width(area) - dx, Rect_height(area) + dy)
65 # c->resize(OBClient::TopRight,
66 # _posqueue[0]->clientarea.width() - _dx,
67 # _posqueue[0]->clientarea.height() + _dy);
68 elif type == Type_RightGrip:
69 OBClient_resize(client, OBClient_TopLeft,
70 Rect_width(area) + dx, Rect_height(area) + dy)
71 # c->resize(OBClient::TopLeft,
72 # _posqueue[0]->clientarea.width() + _dx,
73 # _posqueue[0]->clientarea.height() + _dy);
75 def def_enter(action, win, type, modifiers):
76 client = Openbox_findClient(openbox, win)
78 OBClient_focus(client)
80 def def_leave(action, win, type, modifiers):
81 client = Openbox_findClient(openbox, win)
85 register(Action_EnterWindow, def_enter)
86 #register(Action_LeaveWindow, def_leave)
88 register(Action_ButtonPress, def_motion_press)
89 register(Action_ButtonRelease, def_motion_release)
90 register(Action_MouseMotion, def_motion)
92 print "Loaded clientmotion.py"