title: How to find the X geometry of the root window that excludes any GNOME panels or other GNOME "things"?
body: <p>I need to find a way to obtain the geometry suitable to pass to some X
  window command's <code>-geometry</code> option so that it is guaranteed to cover
  all of the X root window that does not overlap with anything GNOME
  itself manages (e.g., the GNOME Panel window). This is not the same as
  the output of <code>xwininfo -root</code> which will return the geometry for the
  entire X root window, and will necessarily include the real estate
  consumed by the GNOME panel. I don't need the same to be true for KDE
  since I no longer use KDE.</p>
  
  <p>I would preferably like to be able to obtain that geometry using X
  windows command line utilities and not have to resort to Xlib
  programming (i.e., I would like to do so from scripts). The scripts
  can be dependent upon GNOME command-line utilities.</p>
  
  <p>Using basic math to "subtract" out the GNOME Panel would be an option,
  but only if I could have a guarantee that I would only need to account
  for the one and only GNOME Panel X window. But I suspect the GNOME
  Panel window is not the only one that needs to be considered.  I say
  that because there is a window at the bottom that <code>xwininfo</code> reveals
  as "Bottom Expanded Edge Panel" that may or may not be in conflict
  real-estate-wise, since only displays when the mouse is moved to the
  very bottom of the X root window.  But if the GNOME Panel really is
  the only one to consider, then that "subtraction" method might just be
  good enough.</p>
  
  <p>My use case is this: I am using <a href="http://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;ved=0CEwQFjAA&amp;url=http://www.rdesktop.org/&amp;ei=IA7AToNLq9iJAvaTzZED&amp;usg=AFQjCNEMP9DAfvWDNFMBbFla5KfFuDQ1xg" rel="nofollow" title="rdesktop">rdesktop</a> to RDP into various
  Microsoft Windows desktops. The user needs to decide, before executing
  <code>rdesktop</code>, the dimensions on the X window, since it is not resizable
  after it is displayed.  I need that window to consume the maximum
  amount of root window real-estate provided it doesn't conflict with
  the GNOME-managed windows like the GNOME Panel.  What I am doing now
  is hardcoding the geometry for a specific desktop in my wrapper
  scripts that call <code>rdesktop</code>, but that fails to do what I want because
  I work from various desktops that necessarily vary in display
  hardware, with a resulting variation in the X root window geometry.
  Feeding the X root window's geometry to the <code>rdesktop</code> command results
  in a RDP window that extends past the visible area on the GNOME
  desktop since GNOME's window manager pushes the actual upper left
  corner down to avoid overlapping with the GNOME panel, with the result
  that a part of the RDP window is hidden from mouse manipulation.</p>
  
  <p>I have tried using <code>xwininfo -root -children</code> to see if I could find
  some X window in the immediate descendents of the X root that would
  consistently be the window I could use to extract those dimensions,
  but the names look like they are implementation details of the GNOME
  desktop software (or the metacity WM), or both and might not be
  something I want to rely upon.</p>