]>
Dogcows Code - chaz/openbox/blob - scripts/clientmotion.py
ec1da0abb34ec880b0e0c13044a49750ff4475ae
3 def def_motion_press(data
):
4 client
= Openbox_findClient(openbox
, data
.window())
7 newi
= [data
.button(), data
.xroot(), data
.yroot()]
9 newi
.append(new_Rect(OBClient_area(client
)))
12 def def_motion_release(data
):
14 button
= data
.button()
17 client
= Openbox_findClient(openbox
, data
.window())
23 def def_do_move(xroot
, yroot
, client
):
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(xroot
, yroot
, client
, anchor_corner
):
32 dx
= xroot
- posqueue
[0][1]
33 dy
= yroot
- posqueue
[0][2]
34 OBClient_resize(client
, anchor_corner
,
35 Rect_width(area
) - dx
, Rect_height(area
) + dy
)
38 client
= Openbox_findClient(openbox
, data
.window())
42 if not posqueue
[0][0] == 1: return
45 if (type == Type_Titlebar
) or (type == Type_Label
) or \
46 (type == Type_Plate
) or (type == Type_Handle
):
47 def_do_move(data
.xroot(), data
.yroot(), client
)
48 elif type == Type_LeftGrip
:
49 def_do_resize(data
.xroot(), data
.yroot(), client
,
51 elif type == Type_RightGrip
:
52 def_do_resize(data
.xroot(), data
.yroot(), client
,
56 client
= Openbox_findClient(openbox
, data
.window())
59 OBClient_focus(client
)
62 client
= Openbox_findClient(openbox
, data
.window())
64 if leave_unfocus
!= 0:
65 OBClient_unfocus(client
)
68 register(Action_EnterWindow
, def_enter
)
69 register(Action_LeaveWindow
, def_leave
)
71 register(Action_ButtonPress
, def_motion_press
)
72 register(Action_ButtonRelease
, def_motion_release
)
73 register(Action_MouseMotion
, def_motion
)
75 print "Loaded clientmotion.py"
This page took 0.034101 seconds and 4 git commands to generate.