From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-03.nifty.com (conssluserg-03.nifty.com [210.131.2.82]) by sourceware.org (Postfix) with ESMTPS id 1658A3858425 for ; Fri, 23 Dec 2022 03:24:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1658A3858425 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=nifty.ne.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp Received: from HP-Z230 (aj135041.dynamic.ppp.asahi-net.or.jp [220.150.135.41]) (authenticated) by conssluserg-03.nifty.com with ESMTP id 2BN3O7ET023340 for ; Fri, 23 Dec 2022 12:24:07 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com 2BN3O7ET023340 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1671765847; bh=de5PXnJbE5Xgl5RmxL4Uvv6UintojBoLJfQV4S8gT/M=; h=Date:From:To:Subject:In-Reply-To:References:From; b=bLr4BAkXxIp0YtTPSmeMpzd1+P3pFxXxa9GS24YLNFgrtPYoI6YMCqTo4pmLE7aF+ d2fQKyOTYN8azce1WsfHnfC+/hewPqXo+5OG/dzfK2npxN9ZhWYBlM04p2V1ra26k/ rfwgxKMwTlTLSjM77RE2qHYbBkp6yqDwq6//+79kwNSAYKZVMvxLWYe5o1wk1f4gP7 Z9w5rJzh6JowPBg+mK4R/9l+VKFaGW+P4K7O1fUAAtapmOWhGbn4WY6AjmjzEekoZ0 haPeNtZur/Tw6et2wMVQlN8jfwvFauD0Ip20VR2Di6KeJOPzCf90+r1bT0XqPGy6Nf 8OZzdxaaa1Ylg== X-Nifty-SrcIP: [220.150.135.41] Date: Fri, 23 Dec 2022 12:24:08 +0900 From: Takashi Yano To: cygwin-developers@cygwin.com Subject: Re: read vs select on mouse events in console Message-Id: <20221223122408.e2412a32f5ab1bca115a8ae6@nifty.ne.jp> In-Reply-To: References: X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 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? -- Takashi Yano