NEVER call XInternAtom in an application like kwin that provides
a nifty interface for XInternAtom_s_. Have a look at atoms.cpp svn path=/trunk/kdebase/kwin/; revision=48914icc-effect-5.14.5
parent
27f0e99920
commit
eb9d29938b
|
@ -62,6 +62,9 @@ Atoms::Atoms()
|
|||
atoms[n] = &net_kde_docking_windows;
|
||||
names[n++] = (char *) "_NET_KDE_DOCKING_WINDOWS";
|
||||
|
||||
atoms[n] = &net_avoid_spec;
|
||||
names[n++] = (char *) "_NET_AVOID_SPEC";
|
||||
|
||||
XInternAtoms( qt_xdisplay(), names, n, FALSE, atoms_return );
|
||||
for (int i = 0; i < n; i++ )
|
||||
*atoms[i] = atoms_return[i];
|
||||
|
|
1
atoms.h
1
atoms.h
|
@ -29,6 +29,7 @@ public:
|
|||
Atom net_wm_context_help;
|
||||
|
||||
Atom net_kde_docking_windows;
|
||||
Atom net_avoid_spec;
|
||||
|
||||
};
|
||||
|
||||
|
|
12
client.cpp
12
client.cpp
|
@ -1931,24 +1931,20 @@ void Client::updateAvoidPolicy()
|
|||
// 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;
|
||||
|
||||
Status avoidStatus =
|
||||
XGetTextProperty(qt_xdisplay(), win, &avoidProp, avoidAtom);
|
||||
Status avoidStatus = XGetTextProperty(qt_xdisplay(), win, &avoidProp, atoms->net_avoid_spec );
|
||||
|
||||
if (0 != avoidStatus) {
|
||||
if (avoidStatus) {
|
||||
|
||||
// qDebug("XGetTextProperty worked for atom _NET_AVOID_SPEC");
|
||||
|
||||
char ** avoidList;
|
||||
int avoidListCount;
|
||||
|
||||
Status convertStatus =
|
||||
XTextPropertyToStringList(&avoidProp, &avoidList, &avoidListCount);
|
||||
Status convertStatus = XTextPropertyToStringList(&avoidProp, &avoidList, &avoidListCount);
|
||||
|
||||
if (0 != convertStatus) {
|
||||
if (convertStatus) {
|
||||
|
||||
// qDebug("XTextPropertyToStringList succeded");
|
||||
|
||||
|
|
Loading…
Reference in New Issue