MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / getActiveWindow

Function getActiveWindow

lib/linux/advanced-scene-switcher-nix.cpp:324–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322}
323
324int 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
345std::string GetCurrentWindowTitle()
346{

Callers 2

GetCurrentWindowTitleFunction · 0.85
getForegroundProcessPidFunction · 0.85

Calls 2

ewmhIsSupportedFunction · 0.85
dispFunction · 0.70

Tested by

no test coverage detected