Hi Jamey,<br><br>Thanks for all the information!<br>But I am just wondering whether I need to continue the entirely xcb-based Gtk-XCB backend. If necessary, I would like you to have a glance at my code, and any comments would be appreciated.
<br>In addition, I will try to make gdk_window_queue just to iterate the main event queue.<br><br>Best Regards,<br>Jianjun<br><br><div><span class="gmail_quote">On 11/10/06, <b class="gmail_sendername">Jamey Sharp</b> <
<a href="mailto:jamey@minilop.net">jamey@minilop.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Thu, Nov 09, 2006 at 10:20:53PM -0500, Havoc Pennington wrote:
<br>> Jamey Sharp wrote:<br>> > Assuming a project is willing to require the new version of Xlib, then<br>> > avoiding dual-maintenance hell is easy. The Xlib-specific interfaces (in<br>> > this case,
gdkx.h) can still be provided; they become simple wrappers<br>> > that first convert Xlib types to XCB types with help from libX11-xcb,<br>> > then call into the XCB version of the same code. [1]<br>><br>> If I understand what you're saying, the Xlib wrapper around XCB is
<br>> mostly source compatible with Xlib but not fully source compatible and<br>> by no means ABI compatible?<br><br>No, I'm not saying that at all. It's fully backwards-compatible in both<br>API and ABI. However, to take advantage of the new features, you have to
<br>use a couple of functions that obviously don't exist in previous<br>versions of Xlib -- namely, XGetXCBConnection and XSetEventQueueOwner.<br><br>> The wrapper doesn't give a way to keep gtk-x11 ABI compatible, though,
<br>> that I see... ?<br>><br>> As an example, to keep GTK's ABI guarantees/policy, metacity would have<br>> to keep working without recompilation ... and metacity uses Xlibint.h.<br>> So keeping the ABI while cutting to XCB is tough...
<br><br>Obviously, such apps must continue to link against Xlib/XCB, which<br>provides full ABI compatibility even for Xlibint.h. This is why X<br>extensions (which all use Xlibint.h) continue to work when you drop in<br>
the new, XCB-dependent version of Xlib in place of a traditional<br>implementation. No apps or libraries need to be relinked: I'm running<br>stock Debian testing against this XCB-capable Xlib right now.<br><br>> The viable approaches I can think of:
<br>><br>> 1) "cut and run" or "the GTK 1.2 approach" which is basically just leave<br>> the old library ABI compatible and completely untouched for the next 10<br>> years - avoid maintenance burden by not doing any maintenance.
<br><br>If the Gtk+ developers are OK with this, I'm all for it. Making Xlib go<br>away as fast as possible is fine with me. :-) But I don't think you<br>actually have to go there: we've tried hard to ensure that ABI<br>compatibility is not that difficult.
<br><br>> 2) keep one codebase for gdk-xcb and gdk-x11 (which would be most easily<br>> done by pretty much using the xlib API perhaps, but in any case some<br>> kind of abstraction layer perhaps with some simple #ifdef'ing). Build
<br>> the same codebase twice when building gdk, once linking it to X11 and<br>> once linking it to XCB. Apps using this gdk-xcb could just use XCB<br>> directly even though gdk itself would have the shim layer.<br>
<br>The approach I outlined earlier is neither of these, and I think is<br>better than #2. I'm not sure how to make it more clear though; perhaps<br>my earlier mail will make more sense with the above explanations?<br><br>
> The first thing though is probably to step back and ask if it's all<br>> worth it ...<br><br>It's definitely a good question for any substantial change. My opinion<br>is that XCB is fundamentally a better architecture and a better API, and
<br>that the change is worthwhile from a software engineering perspective<br>even if you're right that there's no performance advantage.<br><br>But I believe you'll find you can at least make app startup quite a bit<br>faster on high-latency links -- correct me if I'm wrong, but I haven't
<br>seen any signs that Gtk+ and its dependent libraries have made as much<br>progress as you can easily make with XCB. At the least, Xlib has three<br>useless round-trips in XOpenDisplay that you can't eliminate without<br>
breaking the ABI, and I suspect that few apps should need more than,<br>say, five round trips to put up a window and have all resources ready.<br>It looks to me like gnome-terminal still does more than thirty round<br>trips before it starts drawing, not even taking advantage of existing
<br>Xlib APIs for combining InternAtom round-trips. (This is from a couple<br>minutes poking around with wireshark, and may not reflect reality in any<br>way. But it at least isn't obviously doing the right thing yet.)<br>
<br>I also hope you'll see the libraries above and below Gtk+ migrating to<br>XCB, in which case there will be increasing benefits to using purely XCB<br>throughout the entire stack.<br><br>> Smaller memory footprint is one advantage worth investigating.
<br><br>A complete migration to XCB certainly buys you that and smaller disk<br>footprint, yes. :-)<br><br>--Jamey<br><br><br>-----BEGIN PGP SIGNATURE-----<br>Version: GnuPG v1.4.5 (GNU/Linux)<br><br>iD8DBQFFVAo3p1aplQ4I9mURAlOQAJ9Y2WF8tkLH3vZrt/5gkJO3UzhH/wCfXbqz
<br>tftHwJ9Ppd3ySGboqpExoWU=<br>=QfvK<br>-----END PGP SIGNATURE-----<br><br><br>_______________________________________________<br>gtk-devel-list mailing list<br><a href="mailto:gtk-devel-list@gnome.org">gtk-devel-list@gnome.org
</a><br><a href="http://mail.gnome.org/mailman/listinfo/gtk-devel-list">http://mail.gnome.org/mailman/listinfo/gtk-devel-list</a><br><br><br></blockquote></div><br>