displaying an image on a window

Philip Rushik prushik at gmail.com
Thu Oct 16 00:56:01 PDT 2014


On Thu, Oct 16, 2014 at 3:25 AM, Philip Rushik <prushik at gmail.com> wrote:
> Hi
> I am currently writing a small test program to communicate with the X
> server without using either xlib or xcb. The reason for this is that
> it is part of my ongoing experiment in programming without a libc
> standard C library, which both libraries require. I do see that the
> more code I write, the more it naturally begins to look like XCB.
> So far I have been successful in opening a connection to the server,
> completing the X11 handshake, creating a GC, creating a window, and
> mapping the window to the screen.
> However, I can not seem to convince the X server to display an image.
> The method I am attempting to use is to create a GC, create a window,
> map the window, and then use the put_image request with the drawable
> set to the ID of the created window.
> The network traffic looks good to me on wireshark, but no image
> displays on the window.
>
> Does put image work with a window ID as a drawable? From what I
> understand of the X protocol, I believe it should, is that correct?
> If not, what steps need to be taken in order to display an image on a
> window in the simplest possible manner?
>
> Thanks!
> --Philip


Upon further investigation, I see that the server does actually
respond with an error message. Specifically a MATCH error, however, it
claims that the offending ID is the GC, not the window. I create the
GC with the root window as drawable and a foreground of 0x00aa00ff
(purple).

How should a GC be set up for use in put image requests?


More information about the xorg-devel mailing list