diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-02-08 07:37:22 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-02-08 07:37:22 +0000 |
| commit | 17b0266979137ad957a701c7093a14841a8c2091 (patch) | |
| tree | f924d5efcc92a251fcc399ca5523b8792080e21a /src/client.cc | |
| parent | 1c97e9fb7bede1607b9680d29a791a72b1768019 (diff) | |
No longer using otk widgets for the frame decorations.
The titlebar no long has any buttons, in preparation for a new button system.
Using otk::Size for sizes, and unsigned ints (*PAIN*) we'll see..
Diffstat (limited to 'src/client.cc')
| -rw-r--r-- | src/client.cc | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/client.cc b/src/client.cc index 68653c31..d5be00d0 100644 --- a/src/client.cc +++ b/src/client.cc @@ -29,7 +29,6 @@ namespace ob { Client::Client(int screen, Window window) : otk::EventHandler(), - WidgetBase(WidgetBase::Type_Client), frame(0), _screen(screen), _window(window) { assert(screen >= 0); @@ -581,7 +580,7 @@ void Client::updateTitle() _title = _("Unnamed Window"); if (frame) - frame->setTitle(_title); + frame->adjustTitle(); } @@ -1128,8 +1127,14 @@ void Client::resize(Corner anchor, unsigned int w, unsigned int h) void Client::internal_resize(Corner anchor, unsigned int w, unsigned int h, bool user, int x, int y) { - w -= _base_size.width(); - h -= _base_size.height(); + if (_base_size.width() < w) + w -= _base_size.width(); + else + w = 0; + if (_base_size.height() < h) + h -= _base_size.height(); + else + h = 0; if (user) { // for interactive resizing. have to move half an increment in each @@ -1714,8 +1719,8 @@ void Client::focusHandler(const XFocusChangeEvent &e) otk::EventHandler::focusHandler(e); - frame->focus(); _focused = true; + frame->adjustFocus(); openbox->setFocusedClient(this); } @@ -1729,26 +1734,29 @@ void Client::unfocusHandler(const XFocusChangeEvent &e) otk::EventHandler::unfocusHandler(e); - frame->unfocus(); _focused = false; + frame->adjustFocus(); if (openbox->focusedClient() == this) openbox->setFocusedClient(0); } -void Client::configureRequestHandler(const XConfigureRequestEvent &e) +void Client::configureRequestHandler(const XConfigureRequestEvent &ec) { #ifdef DEBUG - printf("ConfigureRequest for 0x%lx\n", e.window); + printf("ConfigureRequest for 0x%lx\n", ec.window); #endif // DEBUG - otk::EventHandler::configureRequestHandler(e); + otk::EventHandler::configureRequestHandler(ec); // compress these + XConfigureRequestEvent e = ec; XEvent ev; while (XCheckTypedWindowEvent(**otk::display, window(), ConfigureRequest, &ev)) { + // XXX if this causes bad things.. we can compress config req's with the + // same mask. e.value_mask |= ev.xconfigurerequest.value_mask; if (ev.xconfigurerequest.value_mask & CWX) e.x = ev.xconfigurerequest.x; |
