|
|
|
@ -1928,67 +1928,63 @@ QCString Client::sessionId()
|
|
|
|
|
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.
|
|
|
|
|
Atom avoidAtom = XInternAtom(qt_xdisplay(), "_NET_AVOID_SPEC", False);
|
|
|
|
|
XTextProperty avoidProp;
|
|
|
|
|
|
|
|
|
|
XTextProperty avoidProp;
|
|
|
|
|
Status avoidStatus = XGetTextProperty(qt_xdisplay(), win, &avoidProp, atoms->net_avoid_spec );
|
|
|
|
|
|
|
|
|
|
Status avoidStatus =
|
|
|
|
|
XGetTextProperty(qt_xdisplay(), win, &avoidProp, avoidAtom);
|
|
|
|
|
if (avoidStatus) {
|
|
|
|
|
|
|
|
|
|
if (0 != avoidStatus) {
|
|
|
|
|
// qDebug("XGetTextProperty worked for atom _NET_AVOID_SPEC");
|
|
|
|
|
|
|
|
|
|
// qDebug("XGetTextProperty worked for atom _NET_AVOID_SPEC");
|
|
|
|
|
char ** avoidList;
|
|
|
|
|
int avoidListCount;
|
|
|
|
|
|
|
|
|
|
char ** avoidList;
|
|
|
|
|
int avoidListCount;
|
|
|
|
|
Status convertStatus = XTextPropertyToStringList(&avoidProp, &avoidList, &avoidListCount);
|
|
|
|
|
|
|
|
|
|
Status convertStatus =
|
|
|
|
|
XTextPropertyToStringList(&avoidProp, &avoidList, &avoidListCount);
|
|
|
|
|
if (convertStatus) {
|
|
|
|
|
|
|
|
|
|
if (0 != convertStatus) {
|
|
|
|
|
// qDebug("XTextPropertyToStringList succeded");
|
|
|
|
|
|
|
|
|
|
// qDebug("XTextPropertyToStringList succeded");
|
|
|
|
|
avoid_ = true;
|
|
|
|
|
|
|
|
|
|
avoid_ = true;
|
|
|
|
|
|
|
|
|
|
if (avoidListCount != 1) {
|
|
|
|
|
qDebug( "kwin: Client::updateAvoidPolicy(): "
|
|
|
|
|
"Extra values in avoidance list. Ignoring.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char * itemZero = avoidList[0];
|
|
|
|
|
|
|
|
|
|
// qDebug("Anchoring to border %s", itemZero);
|
|
|
|
|
|
|
|
|
|
switch (*itemZero) {
|
|
|
|
|
if (avoidListCount != 1) {
|
|
|
|
|
qDebug( "kwin: Client::updateAvoidPolicy(): "
|
|
|
|
|
"Extra values in avoidance list. Ignoring.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case 'N':
|
|
|
|
|
anchorEdge_ = AnchorNorth;
|
|
|
|
|
break;
|
|
|
|
|
case 'S':
|
|
|
|
|
anchorEdge_ = AnchorSouth;
|
|
|
|
|
break;
|
|
|
|
|
case 'E':
|
|
|
|
|
anchorEdge_ = AnchorEast;
|
|
|
|
|
break;
|
|
|
|
|
case 'W':
|
|
|
|
|
anchorEdge_ = AnchorWest;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
avoid_ = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
char * itemZero = avoidList[0];
|
|
|
|
|
|
|
|
|
|
// qDebug("Anchoring to border %s", itemZero);
|
|
|
|
|
|
|
|
|
|
switch (*itemZero) {
|
|
|
|
|
|
|
|
|
|
case 'N':
|
|
|
|
|
anchorEdge_ = AnchorNorth;
|
|
|
|
|
break;
|
|
|
|
|
case 'S':
|
|
|
|
|
anchorEdge_ = AnchorSouth;
|
|
|
|
|
break;
|
|
|
|
|
case 'E':
|
|
|
|
|
anchorEdge_ = AnchorEast;
|
|
|
|
|
break;
|
|
|
|
|
case 'W':
|
|
|
|
|
anchorEdge_ = AnchorWest;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
avoid_ = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
XFreeStringList(avoidList);
|
|
|
|
|
XFreeStringList(avoidList);
|
|
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
qDebug( "kwin: Client::updateAvoidPolicy(): "
|
|
|
|
|
"XTextPropertyToStringList failed");
|
|
|
|
|
} else
|
|
|
|
|
qDebug( "kwin: Client::updateAvoidPolicy(): "
|
|
|
|
|
"XTextPropertyToStringList failed");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NoBorderClient::NoBorderClient( Workspace *ws, WId w, QWidget *parent, const char *name )
|
|
|
|
|