Search code examples
cx11xlibgdk

Gtk: get usable area of each monitor (excluding panels)


Using gdk_screen_get_monitor_geometry, I can get the total area in pixels and the relative position of each monitor, even when there are two or more used as a single screen.

However, I want to get the usable area (that is, excluding panels) of each monitor. The only thing I have found is _NET_WORKAREA, but that is one giant area stretching across all monitors. Depending on the resolution and arrangement, there may be panels inside this area.

How can I get the actual usable area of each monitor? Ideally, using only Gtk/Gdk, nothing X11-specific.


Solution

  • in the end I ended up using xlib directly, various "tricks" like the one suggested above ended up eventually failing in the long run often with odd corner cases and never followed the KISS principle.

    The solution I used is in the X-Tile code base.