Re: An issue with libX11?

Jon TURNEY <[email protected]>
Newsgroups gmane.os.cygwin.xfree
Message-ID <[email protected]>
On 09/11/2014 20:49, Angelo Graziosi wrote:
> Il 09/11/2014 21:16, Jon TURNEY ha scritto:
>> On 09/11/2014 15:38, Angelo Graziosi wrote:
>>> From another application I have an issue with libX11 which I can
>>> reproduce with the following STC,
>>
>> I don't think this test case is well-formed.
>>
>>> int main()
>>> {
>>>    dis = XOpenDisplay(NULL);
>>>    win = XCreateSimpleWindow(dis, RootWindow(dis, 0), 1, 1, 500, 500,
>>>                              0, BlackPixel (dis, 0), BlackPixel(dis,
>>> 0));
>>>
>>>    XMapWindow(dis, win);
>>
>> A 'XSelectInput(dis, win, KeyPress)' is needed here to tell the X server
>> that this client wishes to receive KeyPress event.s
>
> I found the issue trying the examples of libXbgi library
> (http://libxbgi.sourceforge.net), so I tried to create a STC adapting
> the example discusses here:
>
> https://user.xmission.com/~georgeps/documentation/tutorials/Xlib_Beginner.html
>
>
> Anyway, the STC on Cygwin64 doesn't work if I add your suggestion,
>
> ...
> XMapWindow(dis, win);
> XSelectInput(dis, win, KeyPress);

Oops.  I think that should be KeyPressMask.

> XFlush(dis);
> ...
>
>>
>>> I am not an X11 expert, so it could be I am doing the wrong things but
>>> the same code runs fine on OSX+XQuartz and GCC-4.9.1.
>
> as I wrote, on OSX it works (there XQuartz is 2.7.7). For this reason I
> flagged this to X-Cygwin list..
>
>> I tried with XQuartz 2.7.8_beta1 and I couldn't reproduce that.
>
> On which system? OSX?

XQuartz doesn't run on anything else :D

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.