Metacity theming - making normal windows look like GNOME specific windows (corner rounding, button sizes)
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Metacity theming - making normal windows look like GNOME specific windows (corner rounding, button sizes)
I'm making a theme for my Cinnamon desktop and trying to make GTK2/Qt/etc windows visually conform to the GNOME-type windows (the GTK3 ones with integrated titlebar buttons) as best as possible in order to avoid the annoying visual inconsistencies you typically see. Right now the window buttons / title borders are not consistent looking because the normal windows don't have rounded enough of corners and the window button size is too large: https://i.imgur.com/gH6DxcO.png Ordinary window https://i.imgur.com/LFbmtXV.png Gedit
I can't find anything about changing the amount of window rounding in Metacity themes besides a forum post from 12 years ago (which said it was impossible), which obviously might not be still accurate, only that you can turn it on or off. As for the button size, the GNOME theming guide says the `button_width` and `button_height` properties may be used, but if I use these properties, the window decorations simply do not load. Using the `aspect_ratio` property (as "<aspect_ratio name="button" value="2" />"), which multiple older sources say ought to work, yields the following result: https://i.imgur.com/Yarjj2v.png
Which is less than optimal, to say the least. The documentation on the themes is very scarce; does anyone know how to do those things or whether they can be done?
Could this have something to do with client side decorations (CSD)? GTK3 apps (e.g. gedit) would have these. Maybe they don't properly translate the metacity theme.
So the problem is the other way round - GTK3 CSD doesn't read your metacity themes properly?
Try disabling CSD completely, see which version you get.
Here's a search for CSD theming.
Could this have something to do with client side decorations (CSD)? GTK3 apps (e.g. gedit) would have these. Maybe they don't properly translate the metacity theme.
So the problem is the other way round - GTK3 CSD doesn't read your metacity themes properly?
Try disabling CSD completely, see which version you get.
Here's a search for CSD theming.
Thanks, that PCMan one does work as a temporary solution. I actually prefer the way the CSD windows look (plus in Gedit, the name of the document being both on the window title and immediately below on the header that gets moved out of CSD is pretty redundant and not very aesthetically pleasing), so I would still like to find a way to make all windows look like them, but if nobody knows a way to do that, I suppose this'll work.
Another possibility is to modify the GTK 3 theme so that the CSD header bar looks like the window manager. I did that on my GTK 3 theme. The two can never exactly match, but the difference can be made less jarring.
Ed
I actually prefer the way the CSD windows look (plus in Gedit, the name of the document being both on the window title and immediately below on the header that gets moved out of CSD is pretty redundant and not very aesthetically pleasing), so I would still like to find a way to make all windows look like them
Logically it is impossible to make it adapt in that direction.
Of course you can strive to tell GTK to be more precise about emulating the metacity theme, or make a metacity theme that somehow fits better.
Good news: on the GTK side, it's all CSS - overrides should be easy. Apply a "border-radius: ..." to the proper element in ~/.config/gtk-3.0/gtk.css...
Logically it is impossible to make it adapt in that direction.
Of course you can strive to tell GTK to be more precise about emulating the metacity theme, or make a metacity theme that somehow fits better.
Good news: on the GTK side, it's all CSS - overrides should be easy. Apply a "border-radius: ..." to the proper element in ~/.config/gtk-3.0/gtk.css...
Right, the question I initially asked was in fact about making a Metacity theme that fits better. I don't exactly see how that's "logically impossible," seeing as I do not want to implement CSD elements in window titles or anything complicated like that, I simply want to alter the size of the window buttons and the rounding of the corners - something one would think would be pretty simple to implement both on the developer and the user side. Irrespective of that, it seems like the Metacity developers overlooked adding those basic features or if they did, they failed to document them, and nobody here appears to have any ideas, so I will pursue changing the GTK3 theme instead. Thank you for the guidance with respect to that. I'll keep the question open on the off chance anyone who does know the actual solution stumbles across it, but I'll pursue other routes unless that occurs.
I don't exactly see how that's "logically impossible,"
What I meant is that you cannot expect metacity to somehow know about GTK3 CSD, and adapt to that.
Esp. if GTK3 CSD actually takes hints from the window manager, but I don't know whether it actually does, esp. from metacity which seems to be the old GNOME window manager now used by MATE?
Quote:
Originally Posted by andigena
it seems like the Metacity developers overlooked adding those basic features or if they did, they failed to document them, and nobody here appears to have any ideas
What I meant is that you cannot expect metacity to somehow know about GTK3 CSD, and adapt to that.
Esp. if GTK3 CSD actually takes hints from the window manager, but I don't know whether it actually does, esp. from metacity which seems to be the old GNOME window manager now used by MATE?
At no point have I ever suggested that that's what I want to do. I think you're drawing conclusions from what I have said that are by no means implied. At every stage of this, all I have ever said I wanted to do was to change the Metacity theme to redraw window borders so that they are rounded and window buttons so that they are smaller than the default settings. Never did I say that I want GTK3 CSD to somehow have precedence over Metacity, only that I want to visually replicate it. Which is what the title says "making normal windows LOOK LIKE [CSD] windows." As opposed to the distinctly different "turning normal windows into CSD windows," which is what you seem to have independently decided the subject is about.
If you had actually paid any attention to what I wrote in the original post instead of immediately responding after seemingly just reading the title and perhaps briefly glancing at the first two image links, I think you have noticed that I explicitly mentioned there being prior documentation on that subject which is clearly deprecated based on observations that I included in the very first post (and, you know, the newest form of the documentation being marked as v2.34.1 when the current stable release of Metacity is 3.38.0 makes it pretty apparent too). None of the already scant and outdated documentation mentions changing the extent of window rounding. As you'd see if you actually looked at anything that you just linked.
I would strongly recommend that in the future, you refrain from smugly "RTFM"-ing when you yourself have clearly not done so. You end up with a bit of egg on your face when someone asks about altering window geometry and you, without reading, link a manual (which I read prior to even asking this question, by the way, because I do believe in looking on my own before consulting LQ) whose description of making alterations to window geometry is, in its entirety:
Quote:
The geometry tag defines the sizes of things around the window. It is important, but not easy to explain, and again this file has gone on too long. I'll write it up later.
Wow. Helpful. If only I had made that basic Google search that I did in fact make prior to asking here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.