LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Metacity theming - making normal windows look like GNOME specific windows (corner rounding, button sizes) (https://www.linuxquestions.org/questions/linux-software-2/metacity-theming-making-normal-windows-look-like-gnome-specific-windows-corner-rounding-button-sizes-4175694500/)

andigena 04-29-2021 06:45 PM

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?

ondoho 05-01-2021 04:21 AM

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.

andigena 05-01-2021 01:07 PM

Quote:

Originally Posted by ondoho (Post 6246814)
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.

EdGr 05-01-2021 01:18 PM

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

ondoho 05-01-2021 11:50 PM

Quote:

Originally Posted by andigena (Post 6246975)
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...

andigena 05-02-2021 03:39 PM

Quote:

Originally Posted by ondoho (Post 6247101)
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.

ondoho 05-03-2021 01:23 AM

Quote:

Originally Posted by andigena (Post 6247336)
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 (Post 6247336)
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

Sorry, what "basic features"? Changing button sizes?
https://developer.gnome.org/creating-metacity-themes/
and a few more interesting results with a simple search.

EdGr 05-03-2021 09:33 AM

Quote:

Originally Posted by ondoho (Post 6247423)
Esp. if GTK3 CSD actually takes hints from the window manager, but I don't know whether it actually does

It does not. You need to theme the GTK 3 CSD yourself to look like the window manager.
Ed

andigena 05-03-2021 07:35 PM

Quote:

Originally Posted by ondoho (Post 6247423)
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.
Quote:

Sorry, what "basic features"? Changing button sizes?
https://developer.gnome.org/creating-metacity-themes/
and a few more interesting results with a simple search.
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. :rolleyes:


All times are GMT -5. The time now is 09:03 AM.