Respect local window control layout
Closed this issue · 11 comments
It seems the layout of the close and minimize button are hardcoded.
That layout may not match other desktops, which results in a bad user experience on these systems.
I've put in a pull request to attempt fixing this issue. If you wish to compile the code yourself, you can grab a copy over here to try out. Any feedback would be welcome.
Ah, that the preference button is now pushed too far to the right?
I've just pushed another update to my repo that should hopefully fix that. Fancy having another try?
(I'm not familiar with GTK or Rust for that matter, this is a fair bit of trial and error on my part.)
The GTK3 spec says that all new applications should use HeaderBars, and I want to keep Myxer conforming to that. That's alright though, since the fixed buttons were not a consequence of using a HeaderBar, but is actually an intentional design compromise. I suppose I underestimated how many people would use non-right-aligned buttons, but clearly, it is an issue, so I would like to look for a fix.
The actual issue here is the maximize button. If the window buttons are not overridden, there will be an entirely pointless maximize button that does not do anything because of the geometry constraints (and it shouldn't, an application like Myxer doesn't make sense to have maximized). Unfortunately, GTK isn't smart enough to remove the button on its own when it wouldn't do anything. This means it has to be overridden, but the only way to get that fine-grained control over which buttons are visible is to use set_decoration_layout
, which requires you to hard-code the orientation of the buttons, which is clearly not working.
A potential solution is to use Window Hints, but that would result in the minimize button not showing as well as the maximize button, which I foresee causing other problems. Another is to provide a manual override in the app, which could allow for the rest of the UI to respect the preference better anyway, but couldn't account for the full possibility space present in custom-ordering each individual button.
So currently, I think we're stuck. I'm open to suggestions, as long as they don't conflict with the requirements listed above. I hope someone can figure out a better solution than I have.
The GTK3 spec says that all new applications should use HeaderBars, and I want to keep Myxer conforming to that.
Of the many dozens of GTK3 applications installed on my system, I've only found two applications which do utilise the HeaderBar. (Hypnotix and Web Apps - the latter of which is only used for configuration.)
I'm not a fan of the application or UI toolkit deciding how to render the window borders over my window manager - it just results in an inconsistent desktop experience. Standards may be nice but very few apps seem to conform, and since we have alternative toolkits like QT, Flutter, etc. it is often better to leave this up to the WM.
I dont't have a preference of headerbar or not.
I think leaving the maximize button in there wouldn't be so bad, as it would be more consistent with all other applications. Using it could also a more appealing option in the use case of many audio sources.
For the record I'll leave a before/after patch of how the app looks on Mint 20.
Before: https://i.imgur.com/lwEvfic.png
After: https://i.imgur.com/OtaA1jD.png
I think I might just give up on not showing the Maximize button. It sucks, but if there isn't anything I can do about it without messing up people's UIs, then I'll have to bend.
Header Bars are non-negotiable, however.
I've addressed these issues in 84d5bfc. It will be in the next release that I'm creating shortly.
I think I might just give up on not showing the Maximize button. It sucks, but if there isn't anything I can do about it without messing up people's UIs, then I'll have to bend.
If it makes you feel any better, you never actually disabled maximising on the application. Tiling window managers won't respect the size parameters, and most window managers have keybinds and options that allow for you to maximise without the button.
In testing I ended up maximised 3 times just from double-clicking the title bar.
I'll pull down the commit later today to check it out. There's a small chance I might keep my fork maintained for personal use though; I really don't like the headerbar. (it renders a lot different on my system than on yours. Is that something I can change?)
I'll pull down the commit later today to check it out. There's a small chance I might keep my fork maintained for personal use though; I really don't like the headerbar. (it renders a lot different on my system than on yours. Is that something I can change?
This should have to do with your window manager, or your GTK theme. Unfortunately I can't provide advice for your system specifically, but the theme I use in the screenshots is Arc Dark.