Issue with ubuntu 11.10 onwards when getting system idle time. application gets struck on the line when reaches Xss.INSTANCE.XScreenSaverQueryInfo(display, window, info) and doesnt move forward. Works fine for lower version of ubuntu.unable to get idle time for ubuntu 11.10 onwards . below is the code

public static long getIdleTimeMillis()

X11.Window window = null;

XScreenSaverInfo info = null;

Display display = null;

long idleMillis = 0L;

display = X11.INSTANCE.XOpenDisplay(null);

window = X11.INSTANCE.XDefaultRootWindow(display);
//info = Xss.INSTANCE.XScreenSaverAllocInfo();
info = new XScreenSaverInfo();

Xss.INSTANCE.XScreenSaverQueryInfo(display, window, info);

idleMillis = info.idle.longValue();

//if (info != null) X11.INSTANCE.XFree(info.getPointer());
info = null;

if (display != null) X11.INSTANCE.XCloseDisplay(display);
display = null;

return idleMillis;