jordanbaird / Ice

Powerful menu bar manager for macOS
https://icemenubar.app
GNU General Public License v3.0
12.78k stars 235 forks source link

[Bug]: Any change in monitors while Mac is asleep removes styling #53

Open fastnlight0 opened 5 months ago

fastnlight0 commented 5 months ago

Check existing issues

Description

I have my menu bar styled. When I put my Mac to sleep, change my monitor configuration (close Mac lid, unplug a monitor, etc), then wake it up again (eg. by re-opening the lid), my menu bar is back to normal (unstyled). When I restart the Ice app, or do something to re-trigger the menu bar style (eg. enter and exit full screen on an app or change monitor count), the menu bar re-styles itself.

Even if the monitors are the same when I turn off my Mac and turn it back on (eg. sleep mac, unplug monitor, replug same monitor, wake up Mac), the issue still occurs. If no change in monitors occurs, Ice keeps it's styling when I wake my Mac back up. Closing or opening the lid counts as a monitor change.

Steps to Reproduce

  1. Style your menu bar
  2. Put Mac to sleep
  3. Make any change to monitor setup (you can even go back to the original setup before waking your Mac back up)
  4. Observe your unstyled menu bar

Ice Version

0.8.0 (latest version at time of writing)

macOS Version

14.4.1 (23E224) (latest version at time of writing)

Screenshots

No response

dajabe commented 4 months ago

Something similar also exhibits when you have multiple desktops setup and you switch between the desktops. It shows unstyled for a moment before apply the style a moment later.

I thought the styling feature was cool but since I use multiple desktops and I'm switching between them constantly this would be distracting watching the styling removed and the reapplied over and over.

I figured this might be related so just adding a note here. If it's useful I'll open a separate issue

jordanbaird commented 4 months ago

@dajabe This is the expected behavior. See issue #58. Although, I see that Bartender works around it, so maybe the memory issues I mentioned there wouldn't be a problem.

@fastnlight0 Apologies for the delayed response on this. I haven't had a second monitor to test with for a while. I just got a new one, so I'll see what I can do.

dajabe commented 4 months ago

Ah that is unfortunate i should have gone through your closed issues as well. I suspect this one will be a similar situation.

I have a macbook with notch and two screens. If you want any additional testing feel free to ping me and I'll see what I can do.

jordanbaird commented 4 months ago

@dajabe I'll do some research to see if offscreen windows take up memory. Now that I'm thinking about it, macOS is probably well enough optimized that it might not be a problem. The menu bar would still flash the first time you switch to a desktop, but after that, we can retain the window so that it doesn't do it continuously.

dajabe commented 4 months ago

@jordanbaird I don't know much about how this works in the system and the main feature I wanted is the hiding so I'm definitely low priority 😄

If it helps this bug though I was just noting that there are some similarities in how this bug exhibits and the styling only updating once the screen is rendered. So maybe when it comes out of wake it's hitting a different hook than you currently use to redraw.

jordanbaird commented 2 months ago

@fastnlight0 Is this still a problem in the latest release?

fastnlight0 commented 2 months ago

Yes, but there is a new workaround. The menu bar does lose its styling, but after moving the dock to another display, it fixes itself (the old workarounds still work, but because I always put my dock on my secondary display, I always end up fixing the issue)