#include <glib-object.h>     
#include <gdk/gdk.h>
#include <gdk/gdkx.h>

extern "C" {

guint32
get_base_window_xid (intptr_t pointer)
{
  GdkWindow *window = reinterpret_cast<GdkWindow *> (pointer);

  if (!window)
    return 0;

  window = gdk_window_get_toplevel(window);

  return GDK_WINDOW_XID (window);
}

}
