0

Introduction

I'm using JNIWrapper, and the JAWT subcomponent of that library.

I'm trying to acquire the lock on a JAWT_DrawingSurface with the following code:

JAWT_DrawingSurface *ds = NULL;
ds = awt.GetDrawingSurface(env, comp);
dsLocked = !(ds->Lock(ds) & JAWT_LOCK_ERROR)

But I keep getting dsLocked to be false.

Details

comp is sent to this JNIWrapper code from Java by the following:

Component panel = new VideoViewport().getDisplay();
panel.setBounds(150,150,150,150);
System.out.println("Handle: " + core.utils.X11.X11Utils.getDrawable(panel));

There's not much done to panel either by running VideoViewport() or by getDisplay(), and I don't know what details would be relevant.

Question

What sort of things would cause acquiring the lock on the surface to fail?

karobar
  • 1,250
  • 8
  • 30
  • 61

1 Answers1

0

The Component must be added to a frame and made visible.

When I added the Component to a AWT Frame object and made it visible before the getDrawable(panel) call, it worked and I was able to acquire the lock on the surface.

karobar
  • 1,250
  • 8
  • 30
  • 61