PDA

View Full Version : Third Party X11 Window doesn't wanna fit inside GUI



dsab123
13th June 2012, 15:26
I'm not sure if this counts as a noob question cause this is my first post, as I've been working in Qt for about 3 weeks now. Anyways...

I have this third-party library that is reponsible for creating and displaying a certain type of buffer. I'm sure it uses the Xlib libs somehow.
When I try to embed this XWindow into a GUI i'm working on, it keeps popping up separately from the GUI, but works fine.

At first I thought I just sucked at Qt, but after about 7 or so hours of looking into this, I'm really stumped.

I attempted to solve this problem in a few different ways:

- first, create a QX11EmbedContainer, and embed the XWindow client into this container.




QX11EmbedContainer *container = new QX11EmbedContainer(this);
container -> setFixedSize(320, 240);

//After display creation

void *handler = malloc(sizeof(int *));
thirdPartyFunctionForGettingWindowHandle(thirdPart yDisplay, GET_WINDOW_HANDLE, (void *) handler); //the window handle is returned in handler

container -> embedClient (handler)


Unfortunately this doesn't work, as I'm not entirely sure of the function that returns the window Id.

Second way:

I attempted to create my own XWindow with an associated display, and pass that into the third-party display creation function:



Display *display = XOpenDisplay(NULL);
Window win = XCreateSimpleWindow(display, RootWindow(display, DefaultScreen(display)), 1, 1, 320, 240, 0, BlackPixel(display, 0), BlackPixel(display, 0));
XMapWindow(display, win);
XFlush(display);

...

thirdPartyFunctionForCreatingADisplay(display, NULL, Camera_handle, errorHandler);


This doesn't even compile, as all the third party functions take in only void pointers and do weird stuff with them, and casting doesn't work, of course.

After summing all this info up, I guess nobody on this forum can help me unless they're familiar with the libraries I'm using...sigh. I've emailed the third-party people for some advice on this one.
I don't think I can switch to another window managing system like GTK cause I need their other functions for buffer handling and such.

In any case, is there another way for embedding XWindows that I haven't figured out yet?

(I have to use these libs, by the way)

Thanks!

dsab123
14th June 2012, 21:04
problem solved, looking at wrong version of third party API X(