diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-01-02 22:58:32 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-01-02 22:58:32 +0000 |
| commit | e05d5f7934ce27893f900627fbd06b1679d4c0ad (patch) | |
| tree | 553ced7070d991c96016e5dca53e6068991602e4 /scripts/clientmotion.py | |
| parent | 54da8e404b0baa8b4521ce14c8eb9a28ea64e7f9 (diff) | |
kill button release events
Diffstat (limited to 'scripts/clientmotion.py')
| -rw-r--r-- | scripts/clientmotion.py | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/scripts/clientmotion.py b/scripts/clientmotion.py index dc584893..ec1da0ab 100644 --- a/scripts/clientmotion.py +++ b/scripts/clientmotion.py @@ -20,24 +20,37 @@ def def_motion_release(data): posqueue.remove(i) break +def def_do_move(xroot, yroot, client): + global posqueue + dx = xroot - posqueue[0][1] + dy = yroot - posqueue[0][2] + area = posqueue[0][3] # A Rect + OBClient_move(client, Rect_x(area) + dx, Rect_y(area) + dy) + +def def_do_resize(xroot, yroot, client, anchor_corner): + global posqueue + dx = xroot - posqueue[0][1] + dy = yroot - posqueue[0][2] + OBClient_resize(client, anchor_corner, + Rect_width(area) - dx, Rect_height(area) + dy) + def def_motion(data): client = Openbox_findClient(openbox, data.window()) if not client: return global posqueue - dx = data.xroot() - posqueue[0][1] - dy = data.yroot() - posqueue[0][2] - - area = posqueue[0][3] # A Rect + if not posqueue[0][0] == 1: return + type = data.target() - if (type == Type_Titlebar) or (type == Type_Label): - OBClient_move(client, Rect_x(area) + dx, Rect_y(area) + dy) + if (type == Type_Titlebar) or (type == Type_Label) or \ + (type == Type_Plate) or (type == Type_Handle): + def_do_move(data.xroot(), data.yroot(), client) elif type == Type_LeftGrip: - OBClient_resize(client, OBClient_TopRight, - Rect_width(area) - dx, Rect_height(area) + dy) + def_do_resize(data.xroot(), data.yroot(), client, + OBClient_TopRight) elif type == Type_RightGrip: - OBClient_resize(client, OBClient_TopLeft, - Rect_width(area) + dx, Rect_height(area) + dy) + def_do_resize(data.xroot(), data.yroot(), client, + OBClient_TopLeft) def def_enter(data): client = Openbox_findClient(openbox, data.window()) |
