Get the parent window.
| 344 | |
| 345 | // Get the parent window. |
| 346 | ::Window getParentWindow(::Display* disp, ::Window win) |
| 347 | { |
| 348 | ::Window root = 0; |
| 349 | ::Window parent = 0; |
| 350 | ::Window* children = nullptr; |
| 351 | unsigned int numChildren = 0; |
| 352 | |
| 353 | XQueryTree(disp, win, &root, &parent, &children, &numChildren); |
| 354 | |
| 355 | // Children information is not used, so must be freed. |
| 356 | if (children != nullptr) |
| 357 | XFree(children); |
| 358 | |
| 359 | return parent; |
| 360 | } |
| 361 | |
| 362 | // Get the Frame Extents from EWMH WMs that support it. |
| 363 | bool getEWMHFrameExtents(::Display* disp, ::Window win, long& xFrameExtent, long& yFrameExtent) |