diff --git a/default/Manager.cpp b/default/Manager.cpp index 81a368e42b..d8ed8de8f1 100644 --- a/default/Manager.cpp +++ b/default/Manager.cpp @@ -52,6 +52,8 @@ Manager::Manager( { setBackgroundMode(NoBackground); + shaded_ = false; + connect(options, SIGNAL(resetClients()), this, SLOT(slotReset())); titleBar_ = new TitleBar(this); @@ -109,12 +111,6 @@ Manager::_updateDisplay() resizeBar_->updateDisplay(); } - void -Manager::setShade(bool) -{ - // Wait for parent class version to work. -} - void Manager::paintEvent(QPaintEvent * e) { @@ -209,13 +205,32 @@ Manager::activateLayout() void Manager::fakeMouseEvent(QMouseEvent * e, QWidget * w) { + qDebug("fakeMouseEvent %d", e->type()); QPoint adjustedPos = w->pos() + e->pos(); + if (e->type() == QEvent::MouseButtonDblClick) + toggleShaded(); + QMouseEvent fake(e->type(), adjustedPos, e->button(), e->state()); Client::event(&fake); } + void +Manager::toggleShaded() +{ + if (shaded_) + resize(oldSize_); + else { + oldSize_ = size(); + resize(width(), Static::instance()->titleHeight() + RESIZE_BAR_HEIGHT); + } + + _updateLayout(); + + shaded_ = !shaded_; +} + } // End namespace // vim:ts=2:sw=2:tw=78 diff --git a/default/Manager.h b/default/Manager.h index 5d6417ed07..1919a9b422 100644 --- a/default/Manager.h +++ b/default/Manager.h @@ -40,8 +40,6 @@ class Manager : public Client Manager(Workspace *, WId, QWidget * parent = 0, const char * name = 0); ~Manager(); - void setShade(bool); - void fakeMouseEvent(QMouseEvent *, QWidget *); signals: @@ -64,6 +62,7 @@ class Manager : public Client void paintEvent(QPaintEvent *); void resizeEvent(QResizeEvent *); void activateLayout(); + void toggleShaded(); protected slots: @@ -79,6 +78,8 @@ class Manager : public Client TitleBar * titleBar_; ResizeBar * resizeBar_; + bool shaded_; + QSize oldSize_; }; class ToolManager : public Manager diff --git a/default/TitleText.cpp b/default/TitleText.cpp index 8dff65364f..7de89a525c 100644 --- a/default/TitleText.cpp +++ b/default/TitleText.cpp @@ -77,18 +77,21 @@ TitleText::updatePixmap() TitleText::mousePressEvent(QMouseEvent * e) { client_->fakeMouseEvent(e, this); + DBWidget::mousePressEvent(e); } void TitleText::mouseReleaseEvent(QMouseEvent * e) { client_->fakeMouseEvent(e, this); + DBWidget::mouseReleaseEvent(e); } void TitleText::mouseMoveEvent(QMouseEvent * e) { client_->fakeMouseEvent(e, this); + DBWidget::mouseMoveEvent(e); } void