LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 04-29-2021, 06:45 PM   #1
andigena
Member
 
Registered: Sep 2019
Location: USA
Distribution: nixos, but i prefer plan 9
Posts: 141

Rep: Reputation: 66
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?
 
Old 05-01-2021, 04:21 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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.
 
Old 05-01-2021, 01:07 PM   #3
andigena
Member
 
Registered: Sep 2019
Location: USA
Distribution: nixos, but i prefer plan 9
Posts: 141

Original Poster
Rep: Reputation: 66
Quote:
Originally Posted by ondoho View Post
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.
 
Old 05-01-2021, 01:18 PM   #4
EdGr
Senior Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 1,000

Rep: Reputation: 472Reputation: 472Reputation: 472Reputation: 472Reputation: 472
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
 
Old 05-01-2021, 11:50 PM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by andigena View Post
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...
 
Old 05-02-2021, 03:39 PM   #6
andigena
Member
 
Registered: Sep 2019
Location: USA
Distribution: nixos, but i prefer plan 9
Posts: 141

Original Poster
Rep: Reputation: 66
Quote:
Originally Posted by ondoho View Post
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.
 
Old 05-03-2021, 01:23 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by andigena View Post
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 View Post
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.
 
Old 05-03-2021, 09:33 AM   #8
EdGr
Senior Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 1,000

Rep: Reputation: 472Reputation: 472Reputation: 472Reputation: 472Reputation: 472
Quote:
Originally Posted by ondoho View Post
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
 
Old 05-03-2021, 07:35 PM   #9
andigena
Member
 
Registered: Sep 2019
Location: USA
Distribution: nixos, but i prefer plan 9
Posts: 141

Original Poster
Rep: Reputation: 66
Quote:
Originally Posted by ondoho View Post
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.
 
  


Reply

Tags
metacity



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: KDE Plasma Desktop Massive Update with New Login Manager and Theming for GNOME Apps LXer Syndicated Linux News 0 01-14-2015 10:21 PM
LXer: Why Gnome denies Theming -and the new Tweak Tool! LXer Syndicated Linux News 0 07-07-2012 04:31 PM
How many would be interested in a Metacity theming tutorial? towheedm Linux - General 4 09-28-2011 07:18 AM
define different physical sizes on Multiple Monitors of different sizes MasterC Linux - Desktop 2 03-18-2008 04:24 PM
Theming "Gnome programs" under KDE hand of fate Linux - Software 1 07-11-2004 05:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration