| 322 | } |
| 323 | |
| 324 | int getActiveWindow(Window *&window) |
| 325 | { |
| 326 | if (!ewmhIsSupported()) { |
| 327 | return -1; |
| 328 | } |
| 329 | |
| 330 | Atom active = XInternAtom(disp(), "_NET_ACTIVE_WINDOW", true); |
| 331 | Atom actualType; |
| 332 | int format; |
| 333 | unsigned long num, bytes; |
| 334 | |
| 335 | auto rootWindow = DefaultRootWindow(disp()); |
| 336 | if (!rootWindow) { |
| 337 | return -2; |
| 338 | } |
| 339 | |
| 340 | return XGetWindowProperty(disp(), rootWindow, active, 0L, ~0L, false, |
| 341 | AnyPropertyType, &actualType, &format, &num, |
| 342 | &bytes, (uint8_t **)&window); |
| 343 | } |
| 344 | |
| 345 | std::string GetCurrentWindowTitle() |
| 346 | { |
no test coverage detected