Xlib vs XCB

Programming applications for making music on Linux.

Moderators: MattKingUSA, khz

Post Reply
User avatar
skei
Established Member
Posts: 337
Joined: Sun May 18, 2014 4:24 pm
Has thanked: 8 times
Been thanked: 57 times
Contact:

Xlib vs XCB

Post 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
tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: Xlib vs XCB

Post by tramp »

Can't you just use the Xlib Window as xcb_window_t?
https://xcb.freedesktop.org/MixingCalls/
On the road again.
User avatar
skei
Established Member
Posts: 337
Joined: Sun May 18, 2014 4:24 pm
Has thanked: 8 times
Been thanked: 57 times
Contact:

Re: Xlib vs XCB

Post 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!
Post Reply