-
Notifications
You must be signed in to change notification settings - Fork 134
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
app: add support to hidden minimize and maximize buttons on macos and … #143
base: main
Are you sure you want to change the base?
Conversation
app/os.go
Outdated
// HiddenMinimizeButton hide the window's minimize button | ||
HiddenMinimizeButton bool | ||
// HiddenMaximizeButton hide the window's maximize button | ||
HiddenMaximizeButton bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should either note that these don't work under Linux, or make them work under Linux.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried for days to test on ubuntu with os_x11.go, but still not working.
- _NET_WM_ALLOWED_ACTIONS
- _MOTIF_WM_HINTS
- _NET_WM_WINDOW_TYPE: _NET_WM_WINDOW_TYPE_DIALOG
They all didn't work. I belive these properties also depend on window manager implementation, according to infomations bellow:
- https://specifications.freedesktop.org/wm-spec/1.3/ar01s05.html
- https://stackoverflow.com/questions/14442081/disable-actions-move-resize-minimize-etc-using-python-xlib
- https://superuser.com/questions/186748/how-to-hide-or-minimize-x11-window-from-console
I'll continue wokring to make them work on x11 and wayland, but this may take long time.
So I add tips "only works for windows and macOS" for the options.
Maybe the feature working only on some os is acceptable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the feature working only on some os is acceptable?
Fine with me. Better than nothing! Thanks for trying.
… works for windows and macOS
Can you describe the use-cases you need these controls for? Can we just automatically apply them when, say, MinSize == MaxSize? |
Some usefull cases in my business products:
Sometimes HiddenMaximizeButton can be automatically apply with "MinSize == MaxSize", but not always when size is screen size. Maximizing will make the window as a new fullscreen window in macOS. So leave them standalone will be better. |
Sorry for the slow response; I'm unusually busy these days.
Upon further though, perhaps the rules could be:
What do you think?
Can you elaborate? What is special about the screen size? |
I'm not sure if the rules from app.Option like this
While windows always match the rule |
If you're saying there's no way to revert to no MinSize once a MinSize has been set, then yes. It seems to me Gio will need to allow Would you like to contribute that change as well? |
You are right as the initial size may be But when using And changing the rules change the default window-style which the most users expected. |
Two options
app.HiddenMinimizeButton
andapp.HiddenMaximizeButton
are added to create a window without minimize or/and maximize buttons.hide both minimize and maximize buttons
hide minimize button, keep maximize button: