From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by sourceware.org (Postfix) with ESMTPS id 9FA7F3858D32 for ; Sun, 29 Jan 2023 22:55:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9FA7F3858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rpatterson.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rpatterson.net Received: by mail-oi1-x22b.google.com with SMTP id p133so8685842oig.8 for ; Sun, 29 Jan 2023 14:55:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rpatterson-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=NHYweOm+rG+HQ4NVlqWCv7IQkcn3zuCpw3dKpo6cOuY=; b=wE6/A9xVkJIVXwZPQKYbca8zBw3T0+A4kp3KIVoAb00Nl5pmyhpIAihbesJZgip18S UbhoDL6iH3aKRztE8HUdYU8BtNciBkXcEAQBs1jPesZuD1C8Qb9/h/emqf2pApsqvkko jaCw82BGN2x6kXlvzjwqlSAImijgaGkXxGfyYE6gb2gQhFoIGdTTBJNrOfLMseCieVWM 8E+CIuLgt0ghf1MgKrBzXt+atZKopuDc13fxJOIm8JLcK5EEz22J/dOYVjEWTjXXK+FZ gJzlzZKd6MBL0iO4l/rh9ZAaNsY58xe8K3ZOxrCe0iRZcad6UYlhn1KziW9uKjQKUoPR KvrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NHYweOm+rG+HQ4NVlqWCv7IQkcn3zuCpw3dKpo6cOuY=; b=7AUrtkGXQd6GePvq77c2i0qh31cVDoHNnPn8xpfhVovu4FbZv8U6A2WCyR+Pb4NtZH SOVlEuIRSloL9CRk3shUX5f+o/7f1QQtVM7P0QGA8DT6Jr23qQP9wuUj8RvsCwv1tdGS 6SYGu3ofxVdGqPsc1UpgylIUC0+yxRpywwf7xjXjb0A2+MF+ac/y0f57WLJ5njxwCWG5 0v0CuVrecoSdvoaJSzYkx8SB/JpSqlk+RE2oiZyLk9lcdp93FW0kqjef5o3pAP4sH5cn h2HcV6JHRPdP0IWMucwCHm42NXI/nhnY2GGNz02TY1TqjZzCVhQdzu9OsobyXVgLcM/s iCxw== X-Gm-Message-State: AO0yUKX8WW5E3+o5wePKE/ugksNup1wOIAU+eVoJqsuQTwRh5LclC1qz m0VG2nUWZECb9VQvO6CHa4P0bQAn889CdMGExFNVhdjRIiJPvMSwJjM= X-Google-Smtp-Source: AK7set9rqetlgTnFv9pEaIBE/abVVaaar2IFWJ9KxFqitsBycIWl2O356X0GydbM/3VsorOnUM1jggvx0cHgNNDZBMg= X-Received: by 2002:a05:6808:602:b0:378:f2c:3087 with SMTP id y2-20020a056808060200b003780f2c3087mr247125oih.95.1675032922526; Sun, 29 Jan 2023 14:55:22 -0800 (PST) MIME-Version: 1.0 References: <3bafc985-e382-5b31-bca5-3556ca6e4e40@Shaw.ca> In-Reply-To: <3bafc985-e382-5b31-bca5-3556ca6e4e40@Shaw.ca> From: Ross Patterson Date: Sun, 29 Jan 2023 14:55:11 -0800 Message-ID: Subject: Re: BUG: Log on Scheduled Task invisible/empty window blocks input To: cygwin@cygwin.com Cc: Brian Inglis Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,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: > dash (or bash if required) native path with WD /var/log/ native path e.g. > > %CYGWIN_ROOT%\bin\dash /usr/local/bin/....sh WD %CYGWIN_ROOT%\var\log I'm not understanding the use of `WD` here, can you clarify/elaborate? At any rate, I forgot to mention that I also tried adding output redirection to the end of the action's ""Add arguments (optional)" and did so in various combination with the other variants described in my OP: ... >> C:\...\log\....log 2>&1 And I observed the same or similar mix of different blocking window types. > For normal scripts and schedules, I use cron job commands or scripts whic= h log > everything under /var/log/. In that case, I'd still need `# crond` to run with highest privileges as those are the privileges I ultimately need what it would run to have. But maybe I'll try that if I get time to do more testing. Have you tested the first, most simple, test case from my OP? It's a very elemental test and reproduces the issue reliably for me so it would be interesting to hear what you (or anyone else) observes from that test case. Note that the totally invisible/transparent version of the blocking window is only observable by an area of the display that doesn't respond to mouse inputs. Also note that if your display resolution is high enough, or scaling settings accomplish the same, you need to be able to look for blocked mouse input all over your screen. In my case where it's a 10-foot UI, the default window size blocks most of the display which makes finding blocked mouse input easy. I also find it easiest to test for the presence of the blocking window with something that responds to mouse over inputs with a clear visual signal across the whole display, Kodi in my case. Ross On Fri, Jan 27, 2023 at 11:39 AM Brian Inglis via Cygwin wrote: > > On 2023-01-26 19:43, Ross Patterson via Cygwin wrote: > > TL;DR: I needed to run a Cygwin process at user log on with highest > > privileges to perform some operations that are not allowed any other > > way without requiring a UAC prompt. This results in a window without > > any border, close button or any other decoration that is most often > > invisible/transparent, sometimes opaque white, and most rarely with > > black unusable left/bottom scroll bars. The window is always on top, > > accepts no inputs at all, and blocks input to windows below. The only > > way to get rid of the windows is to kill the scheduled task process or > > trigger a UAC prompt. More details below. > > > > It seems like this probably is a bug, so feel free to consider this a > > bug report, but I'm mostly writing this up so others can find it and > > my workarounds and hopefully save them some hassle and I probably > > won't be doing much followup. Both the edge cases and observed > > results are numerous and each test iteration is time consuming, but > > I've done my best to get as complete coverage as I could and to > > tightly control conditions for reliable results. > > > > There are a few things I want to do through Cygwin that require > > privileges that cannot be attained through a service or a scheduled > > task with an "At startup" trigger. The only way I've found to run the > > process with the required privileges without a UAC prompt and without > > disabling UAC completely is a scheduled task with these settings: > > > > 1. "General" tab: "Run only when user is logged on" =3D SELECTED > > 2. "General" tab: "Run with highest priveleges" =3D CHECKED > > 3. "Triggers" tab: Add an "At log on" trigger for a "Specific user" > > > > As such I've not tested this behavior with different settings on the > > "General" tab. > > I use scheduled tasks with actions running scripts from /usr/local/bin/ u= nder > dash (or bash if required) native path with WD /var/log/ native path e.g. > > %CYGWIN_ROOT%\bin\dash /usr/local/bin/....sh WD %CYGWIN_ROOT%\var\log > > with various options (mainly user SYSTEM, logged in or not, highest privi= leges), > and triggers. > > I never see any windows appearing as the scripts log everything under /va= r/log/. > > The scripts run as tasks start and stop Cygwin services, init and run sma= rt > reporting, clean up cron job remnants before smart reporting, terminate a= ll > processes before running setup. > > For normal scripts and schedules, I use cron job commands or scripts whic= h log > everything under /var/log/. > > -- > Take care. Thanks, Brian Inglis Calgary, Alberta, Canada > > La perfection est atteinte Perfection is achieved > non pas lorsqu'il n'y a plus rien =C3=A0 ajouter not when there is no= more to add > mais lorsqu'il n'y a plus rien =C3=A0 retirer but when there is no= more to cut > -- Antoine de Saint-Exup=C3=A9ry > > -- > Problem reports: https://cygwin.com/problems.html > FAQ: https://cygwin.com/faq/ > Documentation: https://cygwin.com/docs.html > Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple