Page 1 of 1

Xlib vs XCB

Posted: Tue Mar 13, 2018 11:30 am
by skei
Hi!

I'm trying to make a XCB version of my (VST) plugin framework, but I'm having some problems.. When a VST host want to open my edior, it sends an effEditIdle event/call to my plugin, with a Xlib Window as an argument, that I'm supposed to reparent my editor into.. And in the Xlib version, I just used this Window as the parent when creating the editor window.. And it works pretty well..

But xcb_create_window() needs a xcb_window_t as a parent..
So, what do I do? Any suggestions?

I fear I need to go back to the Xlib version, and add gazillions of XLockDisplay() calls everywhere, and I'm not very happy about that.. :-(

- Tor-Helge

Re: Xlib vs XCB

Posted: Tue Mar 13, 2018 11:55 am
by tramp
Can't you just use the Xlib Window as xcb_window_t?
https://xcb.freedesktop.org/MixingCalls/

Re: Xlib vs XCB

Posted: Tue Mar 13, 2018 12:00 pm
by skei
Aaahhh...
Thanks a lot!
If that works, it makes everything so much simpler than I feared..
(I'm far from an expert with neither Xlib og XCB, but I'm trying to learn)

from your link:
"You can now mix calls to XCB and Xlib. The datatypes of the two systems are somewhat interoperable; for example, you can use an Xlib Window anywhere an xcb_window_t is required. In general, XID types like Window are synonymous with their XCB equivalents."

- Tor-Helge

Update:
Just tried it, and it works!
Again, thanks a lot!