app: add support to hidden minimize and maximize buttons on macos and …#143
app: add support to hidden minimize and maximize buttons on macos and …#143kkeybbs wants to merge 4 commits intogioui:mainfrom
Conversation
| // 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.
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.
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.
Maybe the feature working only on some os is acceptable?
Fine with me. Better than nothing! Thanks for trying.
|
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. |
eliasnaur
left a comment
There was a problem hiding this comment.
I agree with your point about the minimize button. I've left a review on your change.
1997c68 to
732c4ec
Compare
|
I've resolved conflicts with newest code from branch main, the pr commits is clean now. |
|
Right, so I'm back to the question: when are you going to use |
|
Yes, I've found none. It seems we should remove this option MaximizeButtonHidden? And should we have the same implementation (automatically hide the button) on macOS instead of these changes? It's quite a lot of changes. |
Yes, I think
Yeah, hiding the maximize button on macOS like on Windows seems like a good idea. I suggest doing that as a separate PR, to keep this PR about the Aside: should the name be |
e8d63ad to
c250d7d
Compare









Two options
app.HiddenMinimizeButtonandapp.HiddenMaximizeButtonare added to create a window without minimize or/and maximize buttons.hide both minimize and maximize buttons
hide minimize button, keep maximize button: