From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) by sourceware.org (Postfix) with ESMTPS id 7027D3858D1E for ; Fri, 23 Dec 2022 09:08:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7027D3858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=towo.net Authentication-Results: sourceware.org; spf=none smtp.mailfrom=towo.net Received: from [192.168.178.72] ([91.65.247.133]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N6bsG-1ooKcD2eYo-0186VE for ; Fri, 23 Dec 2022 10:08:15 +0100 Message-ID: <17a52f3b-c8c4-b4dc-c852-93d5fcb22888@towo.net> Date: Fri, 23 Dec 2022 10:08:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: read vs select on mouse events in console To: cygwin-developers@cygwin.com References: <20221223122408.e2412a32f5ab1bca115a8ae6@nifty.ne.jp> From: Thomas Wolff In-Reply-To: <20221223122408.e2412a32f5ab1bca115a8ae6@nifty.ne.jp> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:K+6JUKnL7NqVQVKJ3TfGGQS1A9AuHI9G1sTkLz24NVixndcA1Gc 50F8hxPKOzJRmiFpIBZfbH/4KOT/RXiOXo6iHhTpQRZtJ0hIjzBhuDWrMN3SCGPS71GgGNp UDXBjJaJSWzMfkg5wCKA6YY4lfHw6S2P/6naA8iB5JHL6rHfGwkGs6TRB5OxsfXDg3DJeL9 fb/LqIcWFLFv3vWfW4bbQ== UI-OutboundReport: notjunk:1;M01:P0:IH97l3nlZ1s=;xKgEFDSL9gaW6klWAM83OfuSaHY J970lmj3RVs5hoq7sj3qaTc3fGAuthoA9m8lJj1FlAf/pzxium+RXteBpalDiQroVvUtyBHS4 0hLLNMfCyrHHLf2LjUiX7wArF95/IKruX8bBwldhu3EeHFVLx3HA/WAHbaMY8nwCviSy6Gfz3 0qQrTHBMBui8gSnoN0EFPqT7Sgob2DQEWvQdHcO9ojMsWZkWmMF4oMLVBSQ40oTsh35Frnn41 ikEW6shY7W9B8eLWnfZ1vBwpzyBTXbK4oNQjAIUPklMIAuycuFdxIowHXloT6ZWjo/2tvkNUj oAOMXvPpWgloF1sjrSsRU1alfNIXZGAQlZ+Vqf+z1dqtgRpm98PSvQ5QJKfvlrS7qmxxB1l3i FAKygxktsSO4oi55RX4O1yUX+A9nObQgaD2pza1qFTKLOLZifh+HO1XrM+c/MFz015jbhrwHL 1IO8Wn823FeYevHACVBvtyBpg3CS82+H1soBXubexpCrrzCuE5WzNEWHlzLN6wgN1tukj+Yv/ TGOdgiYHCvX8JEUKGnqtK87BRaGZjNp9oeDgjlfobnjllyq2o0PHJZhaGdFEihbTIqj2paQlw 0rUnm2Xuub8M5y7ctScXJM2klW5QVKgz9Q7wr3b91zMMT6uzEtcksOkvoOxTC6CE1qS5jA6H8 U5ex00kdSn92Uw+0yUpyV5cFm2vMyEPAiSFPis+UNw== X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Takashi Am 23.12.2022 um 04:24 schrieb Takashi Yano: > Hi Thomas, > > On Thu, 22 Dec 2022 15:55:01 +0100 > Thomas Wolff wrote: >> When I added mouse notification support to the console long ago, I >> deliberately introduced a function mouse_aware() which was common >> between the console version of function read() and the console branch of >> function select(), in order to make sure by design that inconsistencies >> between them could never occur. >> Now I noticed that by some change, mouse_aware() is not used anymore in >> select() code. >> This means that it could happen that either a mouse event would be >> indicated by select() but then not be delivered by read(), so read() >> could stall, >> or (possibly, not sure) the other way round, a mouse event available for >> delivery would not be recognized by select(). >> The attached test case is a rough demonstration of the issue. It uses >> mouse mode DECSET 1000 which has a limited range of mouse coordinates. >> Run it in a maximized console, click into the upper left area, then >> further apart toward lower right, and eventually the program will stall >> until another key is pressed. > mouse_aware() is called from process_input_message(). Currently, > both read() and select() call process_input_message(). So, > mouse_aware() is processed in both read() and select(), I think. > > Therefore, if mouse event has some problem, the cause should be > something another. > > Could you please explain about your test case more detail a bit? > What are the expected behavior and the current behavior? > > I tried: > 1) Maximize command prompt. > 2) Start \cygwin64\bin\bash -l > 3) Start your test case. > 4) Then, "(0)" is displayed every one second. > 5) If push down mouse left button at top left corner, some message is shown. > 6) Another message is shown when release mouse left button. > 7) Move mouse cursor to bottom right corner. > 8) Clicking mouse does not generate any message. > 9) "(0)" is still displayed every one second. > > Is this different from your observation? Or do you expect different behavior? I see different behavior indeed; no further output of (0) and Windows display its message to make a mouse selection in the title bar. The purpose of the test program is to check whether select() reports something available, then read it to actually verify and display the input. OK, I overlooked the nesting in process_input_message, so maybe it's OK, but then still my observation of the test case is mysterious. I'll look further into it, but not so soon... Thanks Thomas