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,
30 client = Openbox_findClient(openbox, win)
36 def def_do_motion(client, xroot, yroot):
38 dx = xroot - posqueue[0][1]
39 dy = yroot - posqueue[0][2]
40 area = posqueue[0][3] # A Rect
41 OBClient_move(client, Rect_x(area) + dx, Rect_y(area) + dy)
43 def def_do_resize(client, xroot, yroot, archor_corner):
45 dx = xroot - posqueue[0][1]
46 dy = yroot - posqueue[0][2]
47 area = posqueue[0][3] # A Rect
48 OBClient_resize(client, anchor_corner,
49 Rect_width(area) - dx, Rect_height(area) + dy)
51 def def_motion(action, win, type, modifiers, xroot, yroot, time):
52 client = Openbox_findClient(openbox, win)
55 if (type == Type_Titlebar) or (type == Type_Label):
56 def_do_move(client, xroot, yroot)
57 elif type == Type_LeftGrip:
58 def_do_resize(client, xroot, yroot, OBClient_TopRight)
59 elif type == Type_RightGrip:
60 def_do_resize(client, xroot, yroot, OBClient_TopLeft)
62 def def_enter(action, win, type, modifiers):
63 client = Openbox_findClient(openbox, win)
65 OBClient_focus(client)
67 def def_leave(action, win, type, modifiers):
68 client = Openbox_findClient(openbox, win)
72 register(Action_EnterWindow, def_enter)
73 #register(Action_LeaveWindow, def_leave)
75 register(Action_ButtonPress, def_motion_press)
76 register(Action_ButtonRelease, def_motion_release)
77 register(Action_MouseMotion, def_motion)
79 print "Loaded clientmotion.py"