[Xcb] Few questions about the X selections

Maxim Levitsky maximlevitsky at gmail.com
Sat Jan 26 11:17:28 PST 2008

On Saturday, 26 January 2008 20:34:27 Barton C Massey wrote:
> In message <18071eea0801260842t7a2dbd5dhb9fd7b17dae02ddd at mail.gmail.com> you wrote:
> > On 26/01/2008, Maxim Levitsky <maximlevitsky at gmail.com> wrote:
> > > Hi,
> > >
> > > I am working on my own X toolkit, and I am now facing the hard part, the ICCCM, or the "ICE Cube: the Lethal weapon....", :-)
> > 
> > Why are you writing your own toolkit?  Waste of time.
> Oh shut up.  It's his time to "waste", and I'm all for him
> wasting it if he wants to.  Do you write software?  If so,
> why?  Waste of time.
Thanks for the support!
> > > Anyway, is there a tool to debug the X selections.
> > > Like to send the ConvertSelection with various types, see the owner of the selection, and so on...
> > >
> > > It isn't hard at all to write one, but it still takes some time.
> > 
> > Well, that depends.  xev and xscope might help you.
> There's also various other things that have X protocol
> analyzers now, such as wireshark.  A lot of folks are
> debugging by running Xephyr under GDB.
Thanks, BTW I use the wireshark for debugging, and it is quite good,
> We could really use a good selections analysis and
> conversion tool, as Maxim describes, though.  I've thought
> about writing one myself, but haven't had the time.  You're
> probably aware of xclip, but it only deals with text
> selections and really doesn't provide much debugging.  I'd
> love to see someone extend or replace it to support
> arbitrary mime types and to give better information about
> what's going on.
Thanks, I consider writing one.
Currently I am at creating a 'window' widget, and since some properties of it has to be set
through X properties according to ICCCM I decided to study it, and now I more or less understand it.
Also I did read the EWMH, but it seems that it doesn't add anything about X selections.

Btw the xcb-utils library somehow doesn't compile on my system, 

xcb_image.c:32:25: error: xcb/xcb_aux.h: No such file or directory
In file included from xcb_image.c:35:
xcb_pixel.h:31:28: error: xcb/xcb_bitops.h: No such file or directory
xcb_pixel.h:32:27: error: xcb/xcb_image.h: No such file or directory
xcb_image.c: In function 'xcb_create_pixmap_from_bitmap_data':
xcb_image.c:793: error: 'xcb_params_gc_t' undeclared (first use in this function)
xcb_image.c:793: error: (Each undeclared identifier is reported only once

Speaking of this library I have few comments about it , it is actually a collection of very small libraries,
maybe it is better to make them a single library?

And there is no yet support for the COMPOUND_TEXT <-> UTF8 conversion.
and this thing is not that easy - I will probably implement it if there is need for that.
I currently see the need in that type only in WM_NAME, but I can implement the _NET_WM_NAME, and
ignore old wm managers which doesn't see it. (I will set the WM_NAME too, but set its type to STRING)

The ICCCM says that clients can cache that atoms thus I implemented a hash table, and populated it
with predefined atoms, and put there all new atoms that were requested.
The xcb-utils uses hash table only for predefined atoms.

Actually I don't yet use xcb-utils at all, but I will use it if necessary.

As for the selections, I think they are quite ok, but the ICCCM misses one thing,
the targets that I need to support.
(On the other hand I probably only need to support the 'TEXT' target, since the text it what the
toolkit manages. For the rare case of image cut&paste I don't yet know what formats I will be expected
to convert to by modern toolkits like QT & GTK.

> > > Besides all the information about the parts of ICCCM that are still relevant, and those that I can ignore is welcome.
> > 
> > All of it is relevant.  Don't go and do what the EWMH has done, and
> > shun bits of it.
> EWMH is a current standard.  Use it.
>     Bart
Thanks a lot,
	Best regards,
		Maxim Levitsky

More information about the Xcb mailing list