From fe4bfc015c476fc60f1fc40ad213e48c0f0c2b13 Mon Sep 17 00:00:00 2001 From: Matthias Ettrich Date: Mon, 21 Aug 2000 12:05:22 +0000 Subject: [PATCH] fixed: title changes in default style, minimization of maximized windows svn path=/trunk/kdebase/kwin/; revision=61601 --- client.cpp | 13 +++++++------ default/kdedefault.cpp | 10 ++++++---- default/kdedefault.h | 4 ++-- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/client.cpp b/client.cpp index 56e5fab289..ed1da75ef7 100644 --- a/client.cpp +++ b/client.cpp @@ -623,6 +623,7 @@ void Client::getWmNormalHints() long msize; if (XGetWMNormalHints(qt_xdisplay(), win, &xSizeHint, &msize) == 0 ) xSizeHint.flags = 0; + } /*! @@ -1220,7 +1221,7 @@ void Client::mouseMoveEvent( QMouseEvent * e) moveResizeMode = TRUE; if ( isMaximized() ) { // in case we were maximized, reset state - geom_restore = QRect(); + geom_restore = QRect(); maximizeChange(FALSE ); } workspace()->setFocusChangeEnabled(false); @@ -1492,8 +1493,8 @@ void Client::invalidateWindow() */ void Client::iconify() { - if (!isMovable()) - return; + if ( windowType() != NET::Normal && windowType() != NET::Toolbar ) // desktop and dock cannot be minimized + return; if ( isShade() ) setShade( FALSE ); @@ -2119,7 +2120,7 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo moveResizeMode = TRUE; if ( isMaximized() ) { // in case we were maximized, reset state - geom_restore = QRect(); + geom_restore = QRect(); maximizeChange(FALSE ); } workspace()->setFocusChangeEnabled(false); @@ -2137,7 +2138,7 @@ bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPo moveResizeMode = TRUE; if ( isMaximized() ) { // in case we were maximized, reset state - geom_restore = QRect(); + geom_restore = QRect(); maximizeChange(FALSE ); } workspace()->setFocusChangeEnabled(false); @@ -2348,7 +2349,7 @@ bool Client::wantsTabFocus() const */ bool Client::isMovable() const { - return may_move && + return may_move && ( windowType() == NET::Normal || windowType() == NET::Toolbar ) && ( !isMaximized() || max_mode != MaximizeFull ); } diff --git a/default/kdedefault.cpp b/default/kdedefault.cpp index df23780ed7..8d78f5ac4a 100644 --- a/default/kdedefault.cpp +++ b/default/kdedefault.cpp @@ -41,9 +41,9 @@ static unsigned char question_bits[] = { static unsigned char unsticky_bits[] = { 0x3c, 0x42, 0x99, 0xbd, 0xbd, 0x99, 0x42, 0x3c}; - + static unsigned char sticky_bits[] = { - 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c}; + 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c}; static QPixmap *titlePix=0; static KPixmap *aUpperGradient=0; @@ -404,6 +404,8 @@ void KDEClient::resizeEvent( QResizeEvent* e) void KDEClient::captionChange( const QString& ) { + if ( isActive() ) + updateActiveBuffer( true ); repaint( titlebar->geometry(), false ); } @@ -587,11 +589,11 @@ void KDEClient::calcHiddenButtons() lastWidth = width(); } -void KDEClient::updateActiveBuffer() +void KDEClient::updateActiveBuffer( bool force ) { static int lastWidth = 0; - if(lastWidth == titlebar->geometry().width()) + if( !force && lastWidth == titlebar->geometry().width()) return; lastWidth = titlebar->geometry().width(); diff --git a/default/kdedefault.h b/default/kdedefault.h index 993ab37df7..b48cd82eee 100644 --- a/default/kdedefault.h +++ b/default/kdedefault.h @@ -20,7 +20,7 @@ public: void reset(); QSize sizeHint() const; int last_button; - + protected: void mousePressEvent( QMouseEvent* e ) { @@ -62,7 +62,7 @@ protected: void activeChange(bool); void calcHiddenButtons(); - void updateActiveBuffer(); + void updateActiveBuffer( bool force = false ); protected slots: void slotReset(); void slotMaximize();