diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-12-25 22:02:34 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-12-25 22:02:34 +0000 |
| commit | 2ae2b257d39ea62640c2590f794e4275c6db1cd4 (patch) | |
| tree | f26abe4a0601d263fbc460eddc012c1d674c868b /src/client.cc | |
| parent | 3c61812e588fb3c34d0713d7f82ccbf21091f032 (diff) | |
might not compile... ob uses its own widgets now, which subclass only the base otk widget. working on compressing focus events and handling them etc.
Diffstat (limited to 'src/client.cc')
| -rw-r--r-- | src/client.cc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/client.cc b/src/client.cc index a22a18a6..2f966cee 100644 --- a/src/client.cc +++ b/src/client.cc @@ -40,6 +40,8 @@ OBClient::OBClient(int screen, Window window) _wmstate = NormalState; // no default decors or functions, each has to be enabled _decorations = _functions = 0; + // start unfocused + _focused = false; getArea(); getDesktop(); @@ -460,6 +462,9 @@ void OBClient::updateTitle() if (_title.empty()) _title = _("Unnamed Window"); + + if (frame) + frame->setTitle(_title); } @@ -859,6 +864,37 @@ void OBClient::close() } +bool OBClient::focus() +{ + if (!_can_focus) return false; + + XSetInputFocus(otk::OBDisplay::display, _window, RevertToNone, CurrentTime); + return true; +} + + +void OBClient::focusHandler(const XFocusChangeEvent &) +{ + frame->focus(); + _focused = true; + + Openbox::instance->setFocusedClient(this); +} + + +void OBClient::unfocusHandler(const XFocusChangeEvent &) +{ + frame->unfocus(); + _focused = false; + + if (Openbox::instance->focusedClient() == this) { + printf("UNFOCUSING\n"); + Openbox::instance->setFocusedClient(0); + } else + printf("UNFOCUSED ALREADY COULDNT UNFOCUS\n"); +} + + void OBClient::configureRequestHandler(const XConfigureRequestEvent &e) { OtkEventHandler::configureRequestHandler(e); |
