I'd suggest you google for the X11 error in question to see if you can
narrow down the parameter causing the problem.
I fiddled around a bit and it seems that i only can have one window at a
time with buttonpress mask. as everything else gives me an error, but i
wasnt able to conjure any buttonpresses from the window however.
XEvent is a union; the only type that will be auto-initialized is the
"type" field. If you define it as a Union, you'll need to set the type
before reading it. You can get away with only defining a few of the
union fields, but make sure the structure is big enough to hold the
biggest structure field.
thanks for clearing this up.
XEvent extends Union {
public int type;
public XButtonEvent xbutton;
...
}
XEvent event;
XNextEvent(d, event);
event.setType(XButtonEvent.class);
event.read();
// java fields are now properly initialized
ill let you know how creating a window on top of it all works out for me.
As of now im just adding listeners to all the windows.