From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3270 invoked by alias); 9 Nov 2014 15:38:44 -0000 Mailing-List: contact cygwin-xfree-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-xfree-owner@cygwin.com Reply-To: cygwin-xfree@cygwin.com Mail-Followup-To: cygwin-xfree@cygwin.com Received: (qmail 3258 invoked by uid 89); 9 Nov 2014 15:38:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp203.alice.it Received: from smtp203.alice.it (HELO smtp203.alice.it) (82.57.200.99) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 09 Nov 2014 15:38:40 +0000 Received: from [192.168.1.102] (87.21.227.179) by smtp203.alice.it (8.6.060.43) (authenticated as angelo.graziosi@alice.it) id 542EA54D079399D2 for cygwin-xfree@cygwin.com; Sun, 9 Nov 2014 16:38:37 +0100 Message-ID: <545F8A73.6010206@alice.it> Date: Sun, 09 Nov 2014 15:38:00 -0000 From: Angelo Graziosi Reply-To: cygwin-xfree@cygwin.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: cygwin-xfree@cygwin.com Subject: An issue with libX11? Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2014-11/txt/msg00003.txt.bz2 From another application I have an issue with libX11 which I can reproduce with the following STC, $ cat getch_test.c /* gcc getch_test.c -lX11 -o getch_test.out DISPLAY=127.0.0.1:0.0 ./getch_test.out */ #include #include #include #include #include #include #include Display *dis; Window win; int fun() { XEvent event; char c; printf("1\n"); while(1) { printf("2\n"); XNextEvent(dis, &event); printf("3\n"); if (event.type == KeyPress) { c = (char) XLookupKeysym(&event.xkey, 0); return (int) c; } } } 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); XFlush(dis); printf("Press a key:\n"); fun(); /*Sleep 5 seconds before closing.*/ //sleep(5); return (0); } Running it, one gets $ DISPLAY=127.0.0.1:0.0 ./getch_test.out Press a key: 1 2 HANGS it does not print "3", so it seems it does not return from XNextEvent(dis, &event); 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. For completeness, I start the Cygwin X server with a link on status bar (W7+Cygwin64) whose target is: C:\cygwin64\bin\run.exe --quote bash -l -c "rm -rf /tmp/.X*; XWin -multiwindow -clipboard -silent-dup-error 2>/dev/null &" Ciao, Angelo. -- 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/