[Xcb] How to implement rectangle selection in XCB?

Bin Zhao belcon at gmail.com
Mon Jun 1 19:23:32 PDT 2015

Hi Michael,

Thanks for your advice. The reason I chose XCB is that I want my application could
be run on both Gnome and Qt. Even other desktop such as FVWM, TWM. I am not
sure whether I am right or not. Perhaps Gtk/Gdk or Qt is also supported by other


> On Jun 2, 2015, at 6:00 AM, Michael Enright <mike at kmcardiff.com> wrote:
> Part of this is fundamentally knowing how to display a selection.
> That's described in graphics text books. The discussion will even
> cover how you don't permanently damage the graphics you drew before
> the selection process started. In reality the pixels on the screen
> MUST change, the engineering is in how to restore the original
> afterwards. Again, standard graphics text books. This one
> (http://www.amazon.com/Computer-Graphics-Principles-Practice-Edition/dp/0201848406)
> is an old, respected book and there's a newer edition.
> Part of this is deciding if your application uses mainly XCB (aka
> X-Windows) directly or does the graphics on something like a Cairo
> surface that you transfer to the screen using XCB.
> Because I don't know why you "want to use XCB to develop an
> application" I won't judge. I have done some simple apps directly with
> XCB or with XCB and a Cairo XCB Surface. However, some say that it's
> better to use higher level stuff like GTK or QT rather than XCB.
> On Sun, May 31, 2015 at 10:25 PM, Maeglin Vardamir <belcon at gmail.com> wrote:
>> Hi guys,
>> I am a newbie to XCB. I want to use XCB to develop an application. Here is
>> what I need to do: select part of one window and save the selected
>> content(picture) to a file. Later, I can use this file to check whether this
>> picture exists in the other window or not.
>> Here I have one question about picture selection
>> Like GIMP, when I click the button of the mice and move it to another
>> position of the specified window, I should draw a rectangle from the point I
>> clicked to where I moved my mice. During the process, the rectangle is
>> growing up. Since I can't change data of the specified window, should I
>> create a transparent window over the target window? Or any other ideas?
>> Thanks,
>>  Belcon
>> _______________________________________________
>> Xcb mailing list
>> Xcb at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/xcb

More information about the Xcb mailing list