From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-04.nifty.com (conssluserg-04.nifty.com [210.131.2.83]) by sourceware.org (Postfix) with ESMTPS id 074693858D1E for ; Fri, 23 Dec 2022 10:20:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 074693858D1E 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-04.nifty.com with ESMTP id 2BNAJj8w020205 for ; Fri, 23 Dec 2022 19:19:45 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com 2BNAJj8w020205 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1671790785; bh=Jl7ppGFY6fvvrZJRGzOwNzf42vXU9HAXUdUXYhZU43s=; h=Date:From:To:Subject:In-Reply-To:References:From; b=kYtMJDzgSQKwKABiRPaQc1SqHtugJCrNrAvm4eLGhjesd80B92Nt/Q0plRFMfLho+ 3WL63Tbpv/XI9Xs045FvXinEPDJmx6vYzKD01HAGk3MPfgtguUfMaSgqWZwZmNmScv VfR/uZg0QETjltP65CpvS/2w9hfdHUVUbuVUTp3a9i3k3lnYKa6V3rY7Z+DIfagEuj A90snILs45I5mJfEWifNPXDQokz97w3/zZ69HfpPIuVuLpPhx/OEO1mtfsP4LbTS4e BttHcHFlHqF08ykxKwnPvYP/+9n/o0krOBvu1maeLvHA6kuos32JIudzf5z7AwmCLI owFob+mVNAR1w== X-Nifty-SrcIP: [220.150.135.41] Date: Fri, 23 Dec 2022 19:19:46 +0900 From: Takashi Yano To: cygwin-developers@cygwin.com Subject: Re: read vs select on mouse events in console Message-Id: <20221223191946.4b6dd028ec5309c228867b87@nifty.ne.jp> In-Reply-To: <17a52f3b-c8c4-b4dc-c852-93d5fcb22888@towo.net> References: <20221223122408.e2412a32f5ab1bca115a8ae6@nifty.ne.jp> <17a52f3b-c8c4-b4dc-c852-93d5fcb22888@towo.net> 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: On Fri, 23 Dec 2022 10:08:20 +0100 Thomas Wolff wrote: > 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. Ah, that may be due to "Quick Edit Mode". It seems that the "Quick Edit Mode" is disabled in the DECSET 1000 range, however, it is enabled outside of the range. So, clicking mouse outside of the range triggers the "Quick Edit Mode" then program is suspended. If you uncheck the "Quick Edit Mode" setting, the problem will probably disappear. Please try. -- Takashi Yano