X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fbackgroundwidget.cc;h=9d660a7939c75cc7fcd8a7332f6586fcf9dba93a;hb=0348a2f3abd2334f5f5812c5fb45c1b4fffb46a5;hp=3d4bb2f2bfbc61660a40e1afbb225659a968ff4c;hpb=1c8090fa67994215f5e79cd9dd08f82110589d8a;p=chaz%2Fopenbox diff --git a/src/backgroundwidget.cc b/src/backgroundwidget.cc index 3d4bb2f2..9d660a79 100644 --- a/src/backgroundwidget.cc +++ b/src/backgroundwidget.cc @@ -8,20 +8,20 @@ namespace ob { -OBBackgroundWidget::OBBackgroundWidget(otk::OtkWidget *parent, - OBWidget::WidgetType type) - : otk::OtkWidget(parent), - OBWidget(type) +BackgroundWidget::BackgroundWidget(otk::Widget *parent, + WidgetBase::WidgetType type) + : otk::Widget(parent), + WidgetBase(type) { } -OBBackgroundWidget::~OBBackgroundWidget() +BackgroundWidget::~BackgroundWidget() { } -void OBBackgroundWidget::setTextures() +void BackgroundWidget::setTextures() { switch (type()) { case Type_Titlebar: @@ -48,9 +48,9 @@ void OBBackgroundWidget::setTextures() } -void OBBackgroundWidget::setStyle(otk::Style *style) +void BackgroundWidget::setStyle(otk::Style *style) { - OtkWidget::setStyle(style); + Widget::setStyle(style); setTextures(); switch (type()) { case Type_Titlebar: @@ -65,57 +65,23 @@ void OBBackgroundWidget::setStyle(otk::Style *style) } -void OBBackgroundWidget::focus() +void BackgroundWidget::focus() { - otk::OtkWidget::focus(); + otk::Widget::focus(); setTextures(); } -void OBBackgroundWidget::unfocus() +void BackgroundWidget::unfocus() { - otk::OtkWidget::unfocus(); + otk::Widget::unfocus(); setTextures(); } -void OBBackgroundWidget::adjust() +void BackgroundWidget::adjust() { - // nothing to adjust here. its done in OBFrame::adjustSize -} - -void OBBackgroundWidget::grabButtons(bool grab) -{ - if (grab) { - // grab simple button clicks on the client, but pass them through too - otk::OBDisplay::grabButton(Button1, 0, _window, true, - ButtonPressMask, GrabModeSync, GrabModeSync, - _window, None, false); - otk::OBDisplay::grabButton(Button2, 0, _window, true, - ButtonPressMask, GrabModeSync, GrabModeSync, - _window, None, false); - otk::OBDisplay::grabButton(Button3, 0, _window, true, - ButtonPressMask, GrabModeSync, GrabModeSync, - _window, None, false); - otk::OBDisplay::grabButton(Button4, 0, _window, true, - ButtonPressMask, GrabModeSync, GrabModeSync, - _window, None, false); - otk::OBDisplay::grabButton(Button5, 0, _window, true, - ButtonPressMask, GrabModeSync, GrabModeSync, - _window, None, false); - } else { - otk::OBDisplay::ungrabButton(Button1, 0, _window); - otk::OBDisplay::ungrabButton(Button2, 0, _window); - otk::OBDisplay::ungrabButton(Button3, 0, _window); - otk::OBDisplay::ungrabButton(Button4, 0, _window); - otk::OBDisplay::ungrabButton(Button5, 0, _window); - } -} - -void OBBackgroundWidget::buttonPressHandler(const XButtonEvent &e) -{ - if (type() == OBWidget::Type_Plate) - XAllowEvents(otk::OBDisplay::display, ReplayPointer, e.time); + // nothing to adjust here. its done in Frame::adjustSize } }