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

[Feature] Rounded corners on all windows #652

Open
radical4ever opened this issue Dec 25, 2022 · 26 comments
Open

[Feature] Rounded corners on all windows #652

radical4ever opened this issue Dec 25, 2022 · 26 comments

Comments

@radical4ever
Copy link

 * muffin version (muffin --version or 'dpkg --list | grep libmuffin0' for Mint/Ubuntu)
 * Distribution - (Mint 17.2, Arch, Fedora 25, etc...)
 * Graphics hardware *and* driver used
 * 32 or 64 bit

Request
Make rounded corners be applied to all windows, so in that way apps look more consistent each other

Other information
There is this proyect Here that makes all windos rounded for gnome desktop, but os it possible to make it for muffin, thank you

@neliavaal
Copy link

This would be so great!

@neliavaal
Copy link

linuxmint/cinnamon#7530

@radical4ever
Copy link
Author

Well, in a point they're dealing the same issue as i opened, but i think is not rlly a theming issue but a window manager issue, that's why i opened here

@GingerGigiCat
Copy link

I have proof that this is in fact possible, the cinnamon extension "Cinnamon Maximus" enables you to remove the titlebar of windows, in turn making the top corners of the window rounded.
Spotify before removing titlebar:
image

After removing titlebar:
image

Surely it can't be hard to do the same thing to the bottom corners automatically?

@mfreeman72
Copy link

Windows, MacOS, KDE (with https://github.com/matinlotfali/KDE-Rounded-Corners), and Gnome (with CSD, libhandy, libadwaita, https://github.com/Spirrwell/mutter-rounded, etc.) all have the ability to round-off all four corners of their windows, and it works and is beautiful. Why couldn't we have that option, too?

@mfreeman72
Copy link

mfreeman72 commented Sep 10, 2024

Since Muffin is based on Mutter, could something like the mutter-rounded fork be done with Muffin as well (leaving out the blur feature, which has been the major problematic part of that project - although that would be cool as well, if perfected)? Something like this screenshot from the mutter-rounded github page would look so amazing in Cinnamon: https://github.com/Spirrwell/mutter-rounded/blob/main/screenshots/screenshots0.jpg

As far as the complaint that rounding the bottom corner would cut off important content (as seen in linuxmint/cinnamon#7530), I was thinking about that a bit. To be cut off, that content would have to exist within 1/2 of the curve radius from the corner. Most radius sizes I've seen in themes using rounded corners are between 5 and 10 pixels. So that would mean content would have to be completely within 2 to 5 pixels of the absolute corner of the window for this to be an issue. In general, all window content I've seen has had a padding around it of 5 pixels or more, and controls, which do usually stick right to the edge of the window, would be terrible if they were much less than 15 pixels across, either vertically or horizontally. So I don't see how rounding corners could realistically be a problem, content-wise.

@JosephMcc
Copy link
Contributor

@mfreeman72 Where you would find an issue is things like scrollbars. Many apps have scrollbars right against the window edge. Including Firefox where I would have the issue right now on Github. This would be even worse if the scrollbars have arrows and some toolkits still have that. Many of the people who want this want things like you see in libadwaita. The corner radius there is at least 12px if I remember correctly.

@neliavaal
Copy link

neliavaal commented Sep 11, 2024

why wouldn't it work in muffin??
image

the scrollbar is fine same for the round bottom corners

@mfreeman72
Copy link

mfreeman72 commented Sep 11, 2024

@mfreeman72 Where you would find an issue is things like scrollbars. Many apps have scrollbars right against the window edge. Including Firefox where I would have the issue right now on Github. This would be even worse if the scrollbars have arrows and some toolkits still have that. Many of the people who want this want things like you see in libadwaita. The corner radius there is at least 12px if I remember correctly.

@JosephMcc I still don't see the problem. Even with a 12px radius, you'd need your scrollbar to be unusably small before the round corner would become too much of a problem. With the main Linux Mint themes, the scrollbar is at least 12px wide when in use, and the corner radius is about 6px. That means that only a few pixels would be cut away from the scrollbar area, which hardly cuts into the padding around the scrollbar (as seen in neliavaal's image). With libadwaita, there is even more padding around the scrollbar, again making the rounded corner not impact the scrollbar at all, but even if it didn't have that amount of padding and a 12px radius, the curve only cuts in about 6 pixels from the corner, meaning extremely little of the scrollbar would be affected, if any. And if there was an arrow control there, even with a 12px radius, the arrow control button at 12 to 15 pixels square (which seems to be a pretty common size in most themes), would still be mostly visible. And since most themes don't include arrow controls anymore, I imagine very few people even pay attention to the arrow controls, let alone actually use them. Most use the scrollbar or the mouse wheel, neither of which would be impacted by the rounded corner. So I really don't see the problem here.

@GingerGigiCat
Copy link

Yes, rounded corners wouldn't interfere with the scrollbar.

It shouldn't be a question of why we should or shouldn't support rounded corners, we should be asking why it hasn't been added yet and how to support it.

@mtwebster
Copy link
Member

It shouldn't be a question of why we should or shouldn't support rounded corners, we should be asking why it hasn't been added yet and how to support it.

  • We have limited time and resources. This is not a priority at this time (who knows what the future may bring).
  • For non-client-decorated windows (ones that only have window buttons on them, like nemo), the bottom corners are very different from the top. Muffin draws the titlebar and therefore we have full control of it via themes. Rounding the bottom corner would require modification of the viewport to the actual content (x11) window. Coding this would be much more complex, for arguable gain.

@mfreeman72
Copy link

@mtwebster Since Muffin is based on Mutter, would it be possible to modify the mutter-rounded patch (https://github.com/Spirrwell/mutter-rounded) to do something similar in Muffin? Or are the code bases too different for that to be a possibility? If the code bases are close enough for a patch like that to work, perhaps most of the coding work has already been done, or at least enough to give us a direction to pursue, in case a volunteer wants to step up and code the thing for you? I really don't know, not knowing what the differences are. It was just a hopeful thought. :)

@GingerGigiCat
Copy link

The mutter-rounded patch is, as far as I'm aware, outdated and unmaintained. However, the original developer has pivoted to developing it as a gnome extension, which I am slowly and dodgily trying to port to cinnamon. Is there an easier way to port a gnome extension to cinnamon than just going through all the files, trying to make them compatible?

@neliavaal
Copy link

check this out guys!!!
it's beautiful..

image

@GingerGigiCat
Copy link

How did you do it?

@neliavaal
Copy link

How did you do it?

It's zorin theme on mint.

@mfreeman72
Copy link

mfreeman72 commented Sep 11, 2024

The mutter-rounded patch is, as far as I'm aware, outdated and unmaintained. However, the original developer has pivoted to developing it as a gnome extension, which I am slowly and dodgily trying to port to cinnamon. Is there an easier way to port a gnome extension to cinnamon than just going through all the files, trying to make them compatible?

@GingerGigiCat I figured that since Muffin is based on Mutter 3.36, while mutter-rounded supports up to Mutter 42.2, that it would be at least somewhat feasible to adapt it to our purposes. A starting point, at least.

@mfreeman72
Copy link

mfreeman72 commented Sep 11, 2024

How did you do it?

It's zorin theme on mint.

@neliavaal Could you give us a step-by-step on this? The only references I can find to applying the Zorin theme to Mint show squared bottom corners. The image you put up looks like you somehow applied libadwaita to Mint-specific software. What was your process to achieve this? Or was this a mock-up?

@neliavaal
Copy link

@mfreeman72
nothing extraordinary
I've just applied zorin theme from the themes selection.
It works only for some apps as you can see

image

@mfreeman72
Copy link

I see. I didn't realize the Mint welcome screen wasn't just basic GTK3.

@SunPodder
Copy link

image
I took the code from yilozt/mutter-rounded and added them manually as the patches are outdated now, and it worked.

I don't think the code is modular enough to be merged into muffin/main though. The border-radius is hardcoded and there are other stuff that needs refactoring. If anyone wants to try out though, the code is here

After you have built and installed the patched muffin libraries, you need to update your LD_LIBRARY_PATH to use the new libs without recompiling cinnamon itself.

I installed my libs under $HOME/.local. So here is what my LD_LIBRARY_PATH looks like:

export LD_LIBRARY_PATH=$HOME/.local/lib/x86_64-linux-gnu/:$HOME/.local/lib/x86_64-linux-gnu/muffin:$LD_LIBRARY_PATH

Restart cinnamon to use the patched libs.

@neliavaal
Copy link

@SunPodder this is perfect!

@mfreeman72
Copy link

mfreeman72 commented Dec 7, 2024

@SunPodder Even though I've been using Linux for decades, I'm a novice at building from source code (I can do the normal "make" commands, but that's not working here), and after a bit of Google searching, nothing I've tried will get this built. Can you recommend some good documentation on how to build this thing?

@SunPodder
Copy link

@SunPodder Even though I've been using Linux for decades, I'm a novice at building from source code (I can do the normal "make" commands, but that's not working here), and after a bit of Google searching, nothing I've tried will get this built. Can you recommend some good documentation on how to build this thing?

muffin uses meson as its build system.

Go into the project root and run:

# turned off wayland support and install into $HOME/.local
meson build -Dwayland=false -Dprefix=$HOME/.local
cd build
ninja -j$(nproc)

# install
ninja install

@GingerGigiCat
Copy link

Wow that's pretty much what i've been failing to do! Strangely, some (most) apps, such as ms edge, spotify, discord and slack (but not pycharm) don't actually extend fully to the right side of the screen when stretched
image
image

@mfreeman72
Copy link

mfreeman72 commented Dec 8, 2024

Ok. I got it installed and running. It looks gorgeous, even if slightly buggy (makes Cinnamon's closing window effect not work correctly, makes the Opacify extension do really strange things to windows, makes Electron menus look and act odd, and libhandy and libadwaita windows no longer have drop shadows behind them). I think this patch could totally be something that could be refined a bit and incorporated as an option in Cinnamon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants