Xlib vs XCB

Programming applications for making music on Linux.

Moderators: khz, MattKingUSA

User avatar
skei
Established Member
Posts: 146
Joined: Sun May 18, 2014 4:24 pm

Xlib vs XCB

Postby skei » Tue Mar 13, 2018 11:30 am

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
todo..

tramp
Established Member
Posts: 1439
Joined: Mon Jul 01, 2013 8:13 am

Re: Xlib vs XCB

Postby tramp » Tue Mar 13, 2018 11:55 am

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: 146
Joined: Sun May 18, 2014 4:24 pm

Re: Xlib vs XCB

Postby skei » Tue Mar 13, 2018 12:00 pm

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!
todo..


Return to “Developer's Section”

Who is online

Users browsing this forum: No registered users and 5 guests