| 180 | } |
| 181 | |
| 182 | std::string XWindowsUtil::atomToString(Display *display, Atom atom) |
| 183 | { |
| 184 | if (atom == 0) { |
| 185 | return "None"; |
| 186 | } |
| 187 | |
| 188 | bool error = false; |
| 189 | XWindowsUtil::ErrorLock lock(display, &error); |
| 190 | char *name = XGetAtomName(display, atom); |
| 191 | if (error) { |
| 192 | return deskflow::string::sprintf("<UNKNOWN> (%d)", (int)atom); |
| 193 | } else { |
| 194 | std::string msg = deskflow::string::sprintf("%s (%d)", name, (int)atom); |
| 195 | XFree(name); |
| 196 | return msg; |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | std::string XWindowsUtil::atomsToString(Display *display, const Atom *atom, uint32_t num) |
| 201 | { |