gtk, to xcb or not

On 11/8/06, Havoc Pennington <hp redhat com> wrote:

It seems pretty clear that gtk-x11 has to continue to be installed -
gdkx.h is in the ABI.

XCB is a replacement for Xlib, so if we contribute the gtk-xcb backend, it should replace gtk-x11. Accordingly, there is gdkxcb.h, instead gdkx.h. However, gtk-xcb cannot provide the compatibility, because of the new gdkxcb.h. The gtk-based application have used gdkx.h, and want to link to gtk-xcb also, it must migrate to use XCB API. Otherwise, you may use Xlib/XCB for compatibility, not the X11-Free-Gtk.

That means a path forward would have to make maintaining both XCB and
libX11 GDK targets a viable option, i.e. just cut-and-pasting the X11
backend and modifying it to be the XCB backend is not feasible. Instead,
for the next many years GTK+ would install a gtk-x11 and a gtk-xcb.

I ported like that just as the fist step. Sharing codes between the two X backend is not an easy problem. Also I think gtk-x11 and gtk-xcb should not coexistence.

The simplest path to have both seems to be to have an abstraction API
that could use libX11 or XCB on the backend. Doesn't XCB have a
libX11-like wrapper API? If so, why not make that the abstraction API?
If not, why not write one that implements what gdk-x11 uses? So an XCB
backend shares virtually all code with the libX11 backend and the libX11
backend is pretty much unchanged.

The XCB API is entirely different from Xlib, it supports latency hiding. XCB would not provide som x11-wrapper API, i think.

In the public XCB API (gdkxcb.h vs. gdkx.h) native XCB API could be
used, and gdk-xcb would not support gdkx.h or would support it only with
footnotes and caveats. This would allow apps to migrate to a
libX11-API-free state by requiring the xcb backend and using gdkxcb.h
instead of gdkx.h.
The resulting gtk-xcb would give people the ability to avoid installing
libX11 on embedded devices, and would give a shot at thread safety
(though gdk and gtk aren't threadsafe anyway).

Now gtk-xcb has arrived the goal. Peple who use gtk need not install libX11 any more. And  gtk-xcb have its own gdkxcb.h, I just have not rename it:)  

Whether it's worth all the pain, I really don't know though ;-)

I would like to know whether  gtk-team has  the  plan for xcb port.
Anyway, thanks for your suggestions!



gtk-devel-list mailing list
gtk-devel-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]