Fixed maximisation. Now kwin really does avoid windows which ask

to be avoided. It also updates nicely. Just move kicker from the
bottom to the left, say, and open a new window. It doesn't cover
kicker. Maximise. Still doesn't cover. Seems to work, then.

svn path=/trunk/kdebase/kwin/; revision=47602
This commit is contained in:
Rik Hemsley 2000-04-26 21:28:51 +00:00
parent 34055e684d
commit f65ca70e0b
3 changed files with 59 additions and 28 deletions

View file

@ -547,6 +547,8 @@ void Client::manage( bool isMapped )
XFree(xch.res_name);
XFree(xch.res_class);
}
workspace()->updateClientArea();
}
@ -1268,30 +1270,53 @@ void Client::closeWindow()
void Client::maximize( MaximizeMode m)
{
if ( isShade() )
setShade( FALSE );
QRect clientArea = workspace()->clientArea();
qDebug("Client::maximise() - area: l: %d r: %d t: %d b: %d",
clientArea.left(), clientArea.right(),
clientArea.top(), clientArea.bottom());
if (isShade())
setShade(false);
if (geom_restore.isNull()) {
if ( geom_restore.isNull() ) {
geom_restore = geometry();
switch ( m ) {
switch (m) {
case MaximizeVertical:
setGeometry( QRect( QPoint( x(), workspace()->geometry().top() ),
adjustedSize( QSize( width(), workspace()->geometry().height()) ) ) );
setGeometry(
QRect(QPoint(x(), clientArea.top()),
adjustedSize(QSize(width(), clientArea.height())))
);
break;
case MaximizeHorizontal:
setGeometry( QRect( QPoint( workspace()->geometry().left(), y() ),
adjustedSize( QSize( workspace()->geometry().width(), height() ) ) ) );
setGeometry(
QRect(
QPoint(clientArea.left(), y()),
adjustedSize(QSize(clientArea.width(), height())))
);
break;
default:
setGeometry( QRect( workspace()->geometry().topLeft(), adjustedSize(workspace()->geometry().size()) ) );
setGeometry(
QRect(clientArea.topLeft(), adjustedSize(clientArea.size()))
);
}
maximizeChange( TRUE );
}
else {
setGeometry( geom_restore );
maximizeChange(true);
} else {
setGeometry(geom_restore);
QRect invalid;
geom_restore = invalid;
maximizeChange( FALSE );
maximizeChange(false);
}
}

View file

@ -250,7 +250,6 @@ void Workspace::init()
inf.row = 0;
cci.append(inf);
}
updateClientArea();
}
Workspace::~Workspace()
@ -344,7 +343,6 @@ bool Workspace::workspaceEvent( XEvent * e )
if ( addDockwin( e->xmaprequest.window ) )
return TRUE;
c = clientFactory( this, e->xmaprequest.window );
updateClientArea();
if ( root != qt_xrootwin() ) {
// TODO may use QWidget:.create
XReparentWindow( qt_xdisplay(), c->winId(), root, 0, 0 );
@ -526,6 +524,7 @@ bool Workspace::destroyClient( Client* c)
if ( c == desktop_client )
desktop_client = 0;
propagateClients();
updateClientArea();
return TRUE;
}
@ -1333,6 +1332,10 @@ void Workspace::deskCleanup(CleanupType ct)
*/
void Workspace::lowerClient( Client* c )
{
// This isn't working yet and the window disappears, so don't
// do anything for now.
return;
if ( !c )
return;
@ -2110,7 +2113,6 @@ void Workspace::slotResetAllClients()
delete oldClient;
newClient->manage( TRUE );
}
updateClientArea();
}
/*!
@ -2215,5 +2217,8 @@ Workspace::updateClientArea()
}
}
}
// Useful when you want to see whether the client area has been
// updated correctly...
// qDebug("clientArea now == l: %d, r: %d, t: %d, b: %d", clientArea_.left(), clientArea_.right(), clientArea_.top(), clientArea_.bottom());
}

View file

@ -141,6 +141,8 @@ public:
SessionInfo* takeSessionInfo( Client* );
void updateClientArea();
public slots:
void setCurrentDesktop( int new_desktop );
// keybindings
@ -238,7 +240,6 @@ private:
PluginMgr mgr;
void updateClientArea();
QRect clientArea_;
};