Kicker is now placed _under_ the Mac menubar - it will not obscure it...

except if you press the hide buttons. That needs fixing.

svn path=/trunk/kdebase/kwin/; revision=48570
This commit is contained in:
Rik Hemsley 2000-05-06 18:59:43 +00:00
parent e167888fd6
commit a982506a75
5 changed files with 57 additions and 36 deletions

View file

@ -10,6 +10,8 @@ class KWinInterface : virtual public DCOPObject
k_dcop: k_dcop:
virtual void updateClientArea() = 0; virtual void updateClientArea() = 0;
virtual QRect clientArea() = 0;
virtual QRect edgeClientArea() = 0;
}; };
#endif #endif

View file

@ -1217,9 +1217,9 @@ void Client::maximize( MaximizeMode m)
{ {
QRect clientArea = workspace()->clientArea(); QRect clientArea = workspace()->clientArea();
qDebug("Client::maximise() - area: l: %d r: %d t: %d b: %d", // qDebug("Client::maximise() - area: l: %d r: %d t: %d b: %d",
clientArea.left(), clientArea.right(), // clientArea.left(), clientArea.right(),
clientArea.top(), clientArea.bottom()); // clientArea.top(), clientArea.bottom());
if (isShade()) if (isShade())
setShade(false); setShade(false);
@ -1894,6 +1894,7 @@ QCString Client::sessionId()
void Client::updateAvoidPolicy() void Client::updateAvoidPolicy()
{ {
// qDebug("kwin: Client::updateAvoidPolicy() - win id == %x", (int)win);
// Find out if we should be avoided. // Find out if we should be avoided.
// If this atom isn't set, set it now. // If this atom isn't set, set it now.
@ -1906,7 +1907,7 @@ void Client::updateAvoidPolicy()
if (0 != avoidStatus) { if (0 != avoidStatus) {
qDebug("XGetTextProperty worked for atom _NET_AVOID_SPEC"); // qDebug("XGetTextProperty worked for atom _NET_AVOID_SPEC");
char ** avoidList; char ** avoidList;
int avoidListCount; int avoidListCount;
@ -1916,17 +1917,18 @@ void Client::updateAvoidPolicy()
if (0 != convertStatus) { if (0 != convertStatus) {
qDebug("XTextPropertyToStringList succeded"); // qDebug("XTextPropertyToStringList succeded");
avoid_ = true; avoid_ = true;
if (avoidListCount != 1) { if (avoidListCount != 1) {
qDebug("Extra values in avoidance list. Ignoring."); qDebug( "kwin: Client::updateAvoidPolicy(): "
"Extra values in avoidance list. Ignoring.");
} }
char * itemZero = avoidList[0]; char * itemZero = avoidList[0];
qDebug("Anchoring to border %s", itemZero); // qDebug("Anchoring to border %s", itemZero);
switch (*itemZero) { switch (*itemZero) {
@ -1950,7 +1952,8 @@ void Client::updateAvoidPolicy()
XFreeStringList(avoidList); XFreeStringList(avoidList);
} else } else
qDebug("XTextPropertyToStringList failed"); qDebug( "kwin: Client::updateAvoidPolicy(): "
"XTextPropertyToStringList failed");
} }
} }

View file

@ -194,7 +194,7 @@ int main( int argc, char * argv[] )
DCOPClient * client = a.dcopClient(); DCOPClient * client = a.dcopClient();
client->attach(); client->attach();
client->registerAs(a.name()); client->registerAs("kwin", false);
return a.exec(); return a.exec();

View file

@ -517,23 +517,6 @@ QRect Workspace::geometry() const
} }
} }
/*!
Returns the workspace's client area.
This is the area within the geometry() where clients can be placed,
i.e. the full geometry minus space for desktop panels, taskbars,
etc.
Placement algorithms should refer to clientArea.
\sa geometry()
*/
QRect Workspace::clientArea() const
{
return clientArea_;
}
/* /*
Destroys the client \a c Destroys the client \a c
*/ */
@ -545,10 +528,11 @@ bool Workspace::destroyClient( Client* c)
stacking_order.remove( c ); stacking_order.remove( c );
focus_chain.remove( c ); focus_chain.remove( c );
c->invalidateWindow(); c->invalidateWindow();
delete c;
clientHidden( c ); clientHidden( c );
if ( c == desktop_client ) if ( c == desktop_client )
desktop_client = 0; desktop_client = 0;
delete c;
c = 0;
propagateClients(); propagateClients();
updateClientArea(); updateClientArea();
return TRUE; return TRUE;
@ -2245,38 +2229,46 @@ Workspace::updateClientArea()
(*it)->updateAvoidPolicy(); (*it)->updateAvoidPolicy();
if ((*it)->avoid()) { if ((*it)->avoid()) {
// qDebug("Looking at client " + (KWM::title((*it)->winId())));
switch (AnchorEdge((*it)->anchorEdge())) { switch (AnchorEdge((*it)->anchorEdge())) {
case AnchorNorth: case AnchorNorth:
// qDebug("KWin: Ignoring a client at edge N"); // qDebug("KWin: Ignoring at edge N");
clientArea_ clientArea_
.setTop(QMAX(clientArea_.top(), (*it)->geometry().bottom())); .setTop(QMAX(clientArea_.top(), (*it)->geometry().bottom()));
break; break;
case AnchorSouth: case AnchorSouth:
// qDebug("KWin: Ignoring a client at edge S"); // qDebug("KWin: Ignoring at edge S");
clientArea_ clientArea_
.setBottom(QMIN(clientArea_.bottom(), (*it)->geometry().top())); .setBottom(QMIN(clientArea_.bottom(), (*it)->geometry().top() - 1));
break; break;
case AnchorEast: case AnchorEast:
// qDebug("KWin: Ignoring a client at edge E"); // qDebug("KWin: Ignoring at edge E");
clientArea_ clientArea_
.setRight(QMIN(clientArea_.right(), (*it)->geometry().left())); .setRight(QMIN(clientArea_.right(), (*it)->geometry().left() - 1));
break; break;
case AnchorWest: case AnchorWest:
// qDebug("KWin: Ignoring a client at edge W"); // qDebug("KWin: Ignoring at edge W");
clientArea_ clientArea_
.setLeft(QMAX(clientArea_.left(), (*it)->geometry().right())); .setLeft(QMAX(clientArea_.left(), (*it)->geometry().right()));
break; break;
default: default:
// qDebug("KWin: Trying to ignore a client, but don't know which edge"); // qDebug("KWin: Not ignoring");
break; break;
} }
} }
// FIXME: Using the hackish method...
if (KWM::title((*it)->winId()) == "MAC MENU [menu]") {
edgeClientArea_ = geometry();
edgeClientArea_.setTop((*it)->geometry().bottom());
}
} }
DCOPClient * client = kapp->dcopClient(); DCOPClient * client = kapp->dcopClient();
@ -2296,3 +2288,13 @@ Workspace::updateClientArea()
// qDebug("clientArea now == l: %d, r: %d, t: %d, b: %d", clientArea_.left(), clientArea_.top(), clientArea_.right(), clientArea_.bottom()); // qDebug("clientArea now == l: %d, r: %d, t: %d, b: %d", clientArea_.left(), clientArea_.top(), clientArea_.right(), clientArea_.bottom());
} }
QRect Workspace::clientArea()
{
return clientArea_;
}
QRect Workspace::edgeClientArea()
{
return edgeClientArea_;
}

View file

@ -90,7 +90,14 @@ public:
Client* findClient( WId w ) const; Client* findClient( WId w ) const;
QRect geometry() const; QRect geometry() const;
QRect clientArea() const;
/**
* @return the area available for clients. This is the desktop
* geometry adjusted for edge-anchored windows.
* Placement algorithms should refer to this rather than geometry().
* @sa geometry()
*/
QRect clientArea();
bool destroyClient( Client* ); bool destroyClient( Client* );
@ -167,6 +174,13 @@ public:
* have changed, this will recalculate the available space. * have changed, this will recalculate the available space.
*/ */
virtual void updateClientArea(); virtual void updateClientArea();
/**
* @return the area available for edge-anchored windows. This
* is the desktop geometry adjusted for other edge-anchored
* windows that have priority.
*/
virtual QRect edgeClientArea();
public slots: public slots:
void setCurrentDesktop( int new_desktop ); void setCurrentDesktop( int new_desktop );
@ -280,7 +294,7 @@ private:
PluginMgr mgr; PluginMgr mgr;
QRect clientArea_; QRect clientArea_, edgeClientArea_;
}; };
inline WId Workspace::rootWin() const inline WId Workspace::rootWin() const