Replies: 2 comments 1 reply
-
I want the effect to be like Safari in full-screen mode. |
Beta Was this translation helpful? Give feedback.
0 replies
-
You need to call MacOS APIs for that https://developer.apple.com/documentation/appkit/nsmenu/setmenubarvisible(_:)?language=objc Something like: internal class MacOSInterop
{
public static void SetNSMenuBarVisible(bool visible)
{
// Get the NSMenu class
var nsMenuClass = GetClass("NSMenu");
// Get the selector for the setMenuBarVisible: method
var setMenuBarVisibleSelector = GetSelector("setMenuBarVisible:");
// Call the setMenuBarVisible: method.
ObjcMsgSend(nsMenuClass, setMenuBarVisibleSelector, visible);
}
[DllImport("/usr/lib/libobjc.A.dylib", EntryPoint = "objc_getClass")]
private static extern IntPtr GetClass(string name);
[DllImport("/usr/lib/libobjc.A.dylib", EntryPoint = "sel_registerName")]
private static extern IntPtr GetSelector(string name);
[DllImport("/usr/lib/libobjc.A.dylib", EntryPoint = "objc_msgSend")]
private static extern void ObjcMsgSend(IntPtr receiver, IntPtr selector, bool arg);
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In macOS, when a window is in full-screen mode and the mouse is moved to the top, the window toolbar will appear. How can I prevent it from displaying?
Beta Was this translation helpful? Give feedback.
All reactions