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

[Bug]: Menu bar shapes didn't appear to work #47

Open
1 task done
Xytronix opened this issue Apr 10, 2024 · 10 comments
Open
1 task done

[Bug]: Menu bar shapes didn't appear to work #47

Xytronix opened this issue Apr 10, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@Xytronix
Copy link

Xytronix commented Apr 10, 2024

Check existing issues

  • I have checked existing issues and believe that my issue is not a duplicate

Description

Shapes don't appear to work with the latest version. I do have tint and shadow activated so perhaps this has to do with it?
In addition menu bar items are out of range to be accessed ( too many icons in the menu bar)

Steps to Reproduce

  1. Go to menu bar
  2. Assign shape

Ice Version

0.8.0

macOS Version

14.4.1

Screenshots

No response

@Xytronix Xytronix added the bug Something isn't working label Apr 10, 2024
@jordanbaird
Copy link
Owner

jordanbaird commented Apr 10, 2024

Could you post a screenshot of what it looks like? Even if it looks like nothing, it will still be helpful, as I can't reproduce it on my machine.

@uncenter
Copy link

uncenter commented Apr 11, 2024

I think I may have had a similar issue - restarted my computer to update (to Sonoma 14.4.1) and after the update completed the menubar was no longer split as configured. I originally thought maybe the update somehow broke it, but it looks like closing and reopening Ice did the trick to get the shape to apply again. Hope that helps.

@TonioGela
Copy link
Sponsor

TonioGela commented Jun 6, 2024

I can confirm that on Sonoma 14.4.1 and Sonoma 14.5 with the Automatically Hidden Menu Bar Setting on, Shapes do not work as per the screenshot.
image

I also noticed that the Hide application menus when showing menu bar items setting is not honoured (if not for ICE itself), so I wonder if it's due to a change in the MenuBar API.

I'll be glad to provide further help/info if necessary, feel free to ask

EDIT. Of course I reopened the app, rebooted, all the normal things you would do. Also my SIP is enabled.

@jordanbaird
Copy link
Owner

I just pushed out an update (0.9.0) a couple hours ago, could those in this thread that have this issue confirm whether it's still a problem after updating?

@jordanbaird
Copy link
Owner

jordanbaird commented Jun 6, 2024

@TonioGela When you say Automatically Hidden Menu Bar settings, do you mean the setting in the Control Center pane of macOS System Settings?

SCR-20240606-hmsc

Or the Automatically rehide setting in Ice?

SCR-20240606-hntd

@TonioGela
Copy link
Sponsor

TonioGela commented Jun 6, 2024

@TonioGela When you say Automatically Hidden Menu Bar settings, do you mean the setting in the Control Center pane of macOS System Settings?

The one in macos System Settings. Funnily enough, disabling and re-enabling it made the menubar styling work again 🤔 (still using 0.8.0)

@jordanbaird
Copy link
Owner

@TonioGela Okay, yeah. I can reproduce this. I didn't take the automatically hiding menu bar into account when I implemented the appearance features. I'll need to figure out some way to check if the menu bar is visible and hide/show the appearance overlay accordingly.

@TonioGela
Copy link
Sponsor

@TonioGela Okay, yeah. I can reproduce this. I didn't take the automatically hiding menu bar into account when I implemented the appearance features. I'll need to figure out some way to check if the menu bar is visible and hide/show the appearance overlay accordingly.

Ah okay, makes sense. You need to check whether there's an os-level API that exposes that setting.

In any case, it's not affecting my user experience as I'm not using this feature. So don't worry about me ;)

@TonioGela
Copy link
Sponsor

TonioGela commented Jun 6, 2024

@TonioGela Okay, yeah. I can reproduce this. I didn't take the automatically hiding menu bar into account when I implemented the appearance features. I'll need to figure out some way to check if the menu bar is visible and hide/show the appearance overlay accordingly.

And I think I found a way to programmatically tell it :D

defaults read NSGlobalDomain "_HIHideMenuBar"

it's either 0 or 1 accordingly.

[EDIT]
There are 2 settings involved.

If you prompt a defaults read NSGlobalDomain | grep -i menu you'll see that these 2 settings change according to the specific hide and show mode.

AppleMenuBarVisibleInFullscreen = 0;
"_HIHideMenuBar" = 1;

The mappings are:

(0,1) => "Always"
(1,1) => "On Desktop Only"
(0,0) => "In Fullscreen Only"
(1,0) => "Never"

So I think you can read these 2 with defaults read NSGlobalDomain <prop>, do your thing (I assume it involves recording that piece of the screen to be able to tell the differences, and then reset them to the previous values (with defaults read NSGlobalDomain <prop> -int 0|1).

Truth to be told, you can also use this trick in case you need to update the data you use to compute the visual delta.

@jordanbaird
Copy link
Owner

jordanbaird commented Jun 6, 2024

My only concern there is the underscore, meaning it's a private API and could change in any macOS release. A reliable way (albeit more expensive) is to use the CGWindowList API to get a list of onscreen windows and filter out the one whose layer is kCGMainMenuWindowLevel. But I worry that might be too computationally expensive, as we'd have to do it repeatedly. I think I'm going to look into the Accessibility API to see if there's a way I can observe the menu bar window frame, but I may use the defaults method as a backup.

EDIT: OR we could use the defaults method as the primary and use either the CGWindowList or Accessibility API as the backup...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants