diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-02-13 07:30:11 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-02-13 07:30:11 +0000 |
| commit | f89831466220b6219a15fa3e670149191055ba5a (patch) | |
| tree | 28efa758b6f1731754682664f1f1a1829274fb44 /src/frame.cc | |
| parent | c88451f0c1e2586a5a06babb69b060bf808c9148 (diff) | |
buttons press!
Diffstat (limited to 'src/frame.cc')
| -rw-r--r-- | src/frame.cc | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/src/frame.cc b/src/frame.cc index 027b7afc..68ff2252 100644 --- a/src/frame.cc +++ b/src/frame.cc @@ -58,7 +58,8 @@ Frame::Frame(Client *client) _desk_press(false), _iconify_press(false), _icon_press(false), - _close_press(false) + _close_press(false), + _press_button(0) { assert(client); @@ -156,6 +157,60 @@ void Frame::hide() } } +void Frame::buttonPressHandler(const XButtonEvent &e) +{ + if (_press_button) return; + _press_button = e.button; + + if (e.window == _max) { + _max_press = true; + renderMax(); + } + if (e.window == _close) { + _close_press = true; + renderClose(); + } + if (e.window == _desk) { + _desk_press = true; + renderDesk(); + } + if (e.window == _iconify) { + _iconify_press = true; + renderIconify(); + } + if (e.window == _icon) { + _icon_press = true; + renderIcon(); + } +} + +void Frame::buttonReleaseHandler(const XButtonEvent &e) +{ + if (e.button != _press_button) return; + _press_button = 0; + + if (e.window == _max) { + _max_press = false; + renderMax(); + } + if (e.window == _close) { + _close_press = false; + renderClose(); + } + if (e.window == _desk) { + _desk_press = false; + renderDesk(); + } + if (e.window == _iconify) { + _iconify_press = false; + renderIconify(); + } + if (e.window == _icon) { + _icon_press = false; + renderIcon(); + } +} + MouseContext::MC Frame::mouseContext(Window win) const { if (win == _frame) return MouseContext::Frame; |
