Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty window from iStat Menus is showing in AltTab #390

Closed
SoPat712 opened this issue Jun 28, 2020 · 17 comments
Closed

Empty window from iStat Menus is showing in AltTab #390

SoPat712 opened this issue Jun 28, 2020 · 17 comments
Labels
bug Something isn't working unreproducible Need help from the author to reproduce the issue

Comments

@SoPat712
Copy link

Describe the bug

IStatMenus(the menubar app) shows as a process in alt-Tab, when it should not. Can you add a blacklist feature that just deals with this by removing it from the array, z

Screenshots / video

image

Steps to reproduce the bug

Download IStatMenus.

Use IStatMenus

See IStatMenus in navigation bar

Possible Solution

Create a blacklist feature that just removes something from the array or whatever you use to hold the apps.

@SoPat712 SoPat712 added the bug Something isn't working label Jun 28, 2020
@lwouis
Copy link
Owner

lwouis commented Jun 30, 2020

Hi @SoPat712! Thanks for reporting this issue!

I'm surprised to see your screenshot, as I've been using iStat Menus for years, and it has always been running on my machine during the development of AltTab. On my machine, the issue doesn't happen. I have iStats Menus 6.40, on macOS 10.15.5.

Could you please use the built-in feedback form in AltTab, and send the link to this ticket in the message box? That will open a new ticket here on github, with a debug profile of your machine (os version, AltTab version, etc). This should help investigate why the issue happens on your machine, but not mine.

@lwouis lwouis added the unreproducible Need help from the author to reproduce the issue label Jun 30, 2020
@lwouis lwouis changed the title IStatMenus shows as a process in alt-tab Empty window from iStat Menus is showing in AltTab Jun 30, 2020
@lwouis
Copy link
Owner

lwouis commented Jun 30, 2020

Also the empty window has the "hidden" icon. Have you perhaps added iStat Menus as a Login Items (i.e. System Preferences > Users & Groups > Login Items) with the "Hide" checkbox checked?

Also what happens when you open the main iStat Menus window? Could you share a screenshot of that?

@lwouis
Copy link
Owner

lwouis commented Jun 30, 2020

From #392:

It's not showing up right now, but It happens like 1/2 times when I start up my macbook

Debug profile

  • App version: 4.1.4
  • App preferences:
    • NSStatusItem Preferred Position Item-0: 20429.5
    • NSWindow Frame com.sindresorhus.Preferences.FrameAutosaveName: 485 570 340 267 0 0 1440 877
    • SUHasLaunchedBefore: 1
    • SULastCheckTime: 2020-06-28 21:37:17 +0000
    • fadeOutAnimation: false
    • hideSpaceNumberLabels: true
    • holdShortcut: ⌘
    • mouseHoverEnabled: false
    • preferencesVersion: 4.1.4
    • showTabsAsWindows: true
  • Applications: 63
  • Windows: 3
    • {isFullscreen: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, spaceId: 5, spaceIndex: 2}
    • {isFullscreen: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, spaceId: 1, spaceIndex: 1}
    • {isFullscreen: false, isMinimized: false, isHidden: false, isTabbed: false, isOnAllSpaces: false, spaceId: 1, spaceIndex: 1}
  • OS version: Version 10.15.5 (Build 19F101)
  • OS architecture: x86_64
  • Locale: en_US (current)
  • Spaces: 2
  • Dark mode: Dark
  • "Displays have separate Spaces": checked
  • Hardware model: MacBookAir6,2
  • Screens: 2
    • {x: 0.0, y: 0.0, width: 1440.0, height: 900.0}
    • {x: -1280.0, y: 277.0, width: 1280.0, height: 1024.0}
  • CPU model: Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz
  • Memory size: 8.59 GB
  • Active CPU count: 4
  • Current CPU frequency: 1.3 Ghz
  • Resource utilization:
    • CPU: 0.0%
    • Memory: 33M
    • Threads count: 17

@lwouis
Copy link
Owner

lwouis commented Jun 30, 2020

@SoPat712 oh! It's very important to learn that it's happening only when the macbook starts! I worked on a similar issue in the past in #292. I discovered some bugs in macOS on apps that launch at startup. I made multiple workarounds but I guess in some scenarios it can still be an issue.

These are a pain to debug because I can't really simulate startup except by literally login out then login in. It's quite painful, and also I can't have the app with debugger at that time, so I need to work off log lines.

@SoPat712
Copy link
Author

SoPat712 commented Jun 30, 2020

Sorry about the late response. This is my startup items in a screenshot

image

It breaks 1/2 times on startup, but then I just kill alt-tab with an alfred workflow.

Shown here:

image

I restart it, also with alfred:

image

Then iStat Menus goes away and I can continue with my use.

image

@SoPat712 SoPat712 closed this as completed Jul 8, 2020
@lwouis
Copy link
Owner

lwouis commented Jul 8, 2020

Hey @SoPat712! I see you closed the issue. Previously you wrote:

It breaks 1/2 times on startup

My understanding thus was that it was an actual issue, as shown on your screenshot, but that was inconsistent in its occurrence, due to startup race conditions between the different login items. Has anything changed that made you close the ticket?

If the issue can manifest itself, even inconsistently, I would like to re-open the ticket.

@SoPat712
Copy link
Author

SoPat712 commented Jul 8, 2020

Hi @lwouis , since there was an easy fix to this problem(which was uncommon enough as is), I felt that there was no need to bother you with unnecessary problems that can't be reproduced. Thanks for the concern, but I entreat you to devote your time to something more important than this random error. However if you feel this is significant enough, then reopening it would be fine by me.

Awaiting your response.

@lwouis
Copy link
Owner

lwouis commented Jul 9, 2020

I'll re-open the issue then 👍

@lwouis lwouis reopened this Jul 9, 2020
@SoPat712
Copy link
Author

SoPat712 commented Jul 9, 2020

I wish I could help you out in the coding process, but sadly I don't know Swift at all. One of these days I'm going to have to start learning it.

@lwouis
Copy link
Owner

lwouis commented Aug 13, 2020

Hey @SoPat712! I was curious, is the issue still happening on recent versions of AltTab these days?

@SoPat712
Copy link
Author

SoPat712 commented Sep 7, 2020

Oops. I completely forgot to close this issue. The bug is not happening anymore, and I've also blacklisted iStatMenuWidget.

@SoPat712 SoPat712 closed this as completed Sep 7, 2020
@lwouis
Copy link
Owner

lwouis commented Sep 7, 2020

I'll keep it open to remember to test it myself. The other day I think I saw some funky stuff at launch. I don't reboot a lot, so I don't run into these scenarios much, and I would like to take some time to actually test this more.

If you blacklisted iStats, then the issue could still be there but you are personally no longer impacted by it, whereas new users could be

@lwouis lwouis reopened this Sep 7, 2020
@SoPat712
Copy link
Author

SoPat712 commented Sep 7, 2020

I only blacklisted it in 6.2.0, I hadn't seen it after updating from 5.3 I believe. I'm pretty sure it's fixed, but if you'd like to keep it open, that's okay too.

@lwouis
Copy link
Owner

lwouis commented Oct 27, 2020

@SoPat712 Did you get this issue again since we last discussed it? I've had to logout>login many time for another issue, and I never once saw iStats show like in this ticket. Not any other app actually. I think it may be time to close this ticket.

@SoPat712
Copy link
Author

As said before, I blacklisted the issue. It has never happened for me, but it is inconvenient to not be able to see the settings window.

@lwouis
Copy link
Owner

lwouis commented Oct 27, 2020

I added a check on a minimum window size of 100x100. It will be present in the next release. I think it would prevent showing such 0 size window as we see on your screenshot above. You could un-blacklist the app, once you are on the new release.

@lwouis
Copy link
Owner

lwouis commented Feb 22, 2021

I think the command open -j recreates the behavior of an app launched at login, with Login Items > Hide checked. Note that you also need this to get the full behavior:

image

Through that nice reproduction tool, I was able to study the inner mechanisms of this corner-case of macOS. An app launched like this will:

  • Not send the expected events about creating its windows
  • Not show any windows when asked for them, right after launch
  • Send some windowsFocusedChanged/mainWindowChanged events quickly after launch
  • Not report as isHidden at launch, even though it is visually hidden, and the UI says "Hide" in Login Items and the docs say "Hidden" in open -j man

Thus the workaround I added is to check if an app is isActive at launch. If not, we consider it has never been shown so far. Later, when if we receive windowsFocusedChanged/mainWindowChanged events, we check if the app has never been shown so far. If yes, we get its windows (at this point, we get them; unlike right after launch).

I think this workaround is going to help with Login Items, as well as maybe some other edge-cases 👍

lwouis pushed a commit that referenced this issue Feb 23, 2021
## [6.15.2](v6.15.1...v6.15.2) (2021-02-23)

### Bug Fixes

* avoid restarting alt-tab in some rare scenarios ([#825](#825)) ([4003df4](4003df4))
* show windows of apps launched hidden ([#390](#390)) ([eb5d019](eb5d019))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unreproducible Need help from the author to reproduce the issue
Projects
None yet
Development

No branches or pull requests

2 participants