Since themes are one subject that’s getting some Metacity traffic, I’d love a metacity theme that looks like XFCE’s Prelude-4 (http://www.xfce-look.org/content/show.php/prelude-4?content=69300). I’m happy to design it myself, but I’m horribly confused by the theming engine. Should I chop up a window border image into lots of little bits and piece them together, or make one big window image and tell the theme about it, or use SVG, or…some other approach? I can’t really get a grip on it, especially since my theme doesn’t have any height for title text…
Ooh, pretty. Are red, yellow, green for close, minimise, maximise/restore as on OS X? What’s the white rectangle floating to the top of the window– is it a shaded window or something?
I think I will use this as part of a tutorial for writing themes, if you like.
I think the colours follow OS X, and I think that the rectangle is a shaded window, indeed. All I have to go on is the screenshot because I just like the look of it; I should really install xfce to play with it a bit :-)
Assorted bag of questions:
What is the state of the Metacity compositor? Will it see some new features, or does it just exist to enable compositing for other applications? Will compositing ever be on by default on a stock Metacity?
And this whole GNOME Shell fad… what is Metacity’s role there, since Shell seems to assume the role of window manager as well?
Also, a tutorial for writing themes would be ultra-excellent. I’m still not sure whether I should use tiny PNGs for the buttons/windowborders (as the XFCE version does) or draw-ops to just draw them (since the buttons are just lines, after all), and phrases like “[d]etermines whether the title text height should be included in the height calculator” in the theming guide (http://developer.gnome.org/doc/tutorials/metacity/metacity-themes.html) aren’t all that useful because I don’t understand what they mean — is the “height calculator” calculating the height of the title bar? the height of the window? er? confused, as mentioned. I look forward with bated breath to your guide, especially if my desired theme is one of the example ones and so I don’t have to do any work ;)
How about a option when right clicking on the titlebar to remember window position ? In this day in age of giant monitors this would be a plus. Also how about open window under cursor ?
I learned a lot when I sat down and built a metacity theme, but so much of the theme format has no obvious relation to the layman’s intuitive understanding of window management. Once you’ve played with some themes and experimented with metacity-theme-viewer and metacity-window-demo they begin to become clear, but actually sitting down and explaining what’s going on is… daunting. That’s why all seventeen Metacity theme tutorials explain about half the details and then say “…and I’ll get around to explaining the reset later”.
Stuart, the answer to your specific question is that the frame_geometry element is how metacity determines how far the decorations will extend beyond the basic window. If has_title is true, then the ‘top_height’ value is calculated as title_border.bottom+title_height+title_vertical_pad+title_border.top. If has_title is false, then ‘top_height’ is calculated as title_border.bottom + title_border.top (…I think; better check it yourself)
As for drawing button icons, I strongly recommend sticking to draw_ops for the shapes that can be drawn with them because they’re resolution independant and you can change all the colours to fit with the GTK theme (or colour-constants, if you’re using version-2 themes). If there’s a shape you can’t draw with draw_ops, you’ll have to use a PNG file (no point in using SVG files, see bug 561896).
I have a few changes I’d like to see in the Metacity theme format, but I suppose I should be filing wishlist bugs for them instead of complaining on a blog. :)
lostson: if an app isn’t remembering window positions then it’s a bug in the app. If the app doesn’t do it then you may want to investigate devilspie, which may do it for you, rather than metacity. I believe that’s the policy.
Screwtape: this is all exceedingly useful information! My plan was to wail enough that someone else built a wysiwyg editor, but hey ;-)
Plenty of people will disagree that every single app should have code that remembers window position. Maybe if there’s a way to add to metacity’s context menu devilspie can add something there.
Stuart so your telling me that gnome-terminal, firefox, gedit, and others should all remember their position when I close them ? and then always come back to the same spot ? If this were the case why would one need a window manager. All you really have then is a windowbar with a title on it then because its surely not managing anything then. And why would a application writer, write code into his app for this ? The window manager is supposed to place your apps(aka windows) on the desktop not the application. Now for applications that use a system tray icon yes definitely, when you send the application to the tray and then click on the tray icon to bring them back. That I can see being coded into the application. As far as Devilspie, its just another confusing tool to use that a user is gonna have to install after he finds out Metacity doesn’t do what they need it to do.
Several WM’s have this as a feature Fluxbox, E16, and KDE3 series. It is very helpful as far as I am concerned. For instance I probably open Evolution 15+ times a day and I would to always open in the same spot when I click on my mail-notification icon in the system tray, yet it does not. It always pops up in the left hand top corner. There are just some apps that you want in a certain spot all the time whether the app knows it or not.
Can metacity move the title bar from the tops of windows to the sides? This would help on small widescreen displays like the Eee PC (1024 x 600). wm2 does this: http://all-day-breakfast.com/wm2/ .
@Andrew Gaul:
Not in the current version of the theme format. It’d certainly be something that could be considered for a version 3, if anyone was interested in raising a bug.
Since themes are one subject that’s getting some Metacity traffic, I’d love a metacity theme that looks like XFCE’s Prelude-4 (http://www.xfce-look.org/content/show.php/prelude-4?content=69300). I’m happy to design it myself, but I’m horribly confused by the theming engine. Should I chop up a window border image into lots of little bits and piece them together, or make one big window image and tell the theme about it, or use SVG, or…some other approach? I can’t really get a grip on it, especially since my theme doesn’t have any height for title text…
Ooh, pretty. Are red, yellow, green for close, minimise, maximise/restore as on OS X? What’s the white rectangle floating to the top of the window– is it a shaded window or something?
I think I will use this as part of a tutorial for writing themes, if you like.
I think the colours follow OS X, and I think that the rectangle is a shaded window, indeed. All I have to go on is the screenshot because I just like the look of it; I should really install xfce to play with it a bit :-)
Assorted bag of questions:
What is the state of the Metacity compositor? Will it see some new features, or does it just exist to enable compositing for other applications? Will compositing ever be on by default on a stock Metacity?
And this whole GNOME Shell fad… what is Metacity’s role there, since Shell seems to assume the role of window manager as well?
Also, a tutorial for writing themes would be ultra-excellent. I’m still not sure whether I should use tiny PNGs for the buttons/windowborders (as the XFCE version does) or draw-ops to just draw them (since the buttons are just lines, after all), and phrases like “[d]etermines whether the title text height should be included in the height calculator” in the theming guide (http://developer.gnome.org/doc/tutorials/metacity/metacity-themes.html) aren’t all that useful because I don’t understand what they mean — is the “height calculator” calculating the height of the title bar? the height of the window? er? confused, as mentioned. I look forward with bated breath to your guide, especially if my desired theme is one of the example ones and so I don’t have to do any work ;)
How about a option when right clicking on the titlebar to remember window position ? In this day in age of giant monitors this would be a plus. Also how about open window under cursor ?
I learned a lot when I sat down and built a metacity theme, but so much of the theme format has no obvious relation to the layman’s intuitive understanding of window management. Once you’ve played with some themes and experimented with metacity-theme-viewer and metacity-window-demo they begin to become clear, but actually sitting down and explaining what’s going on is… daunting. That’s why all seventeen Metacity theme tutorials explain about half the details and then say “…and I’ll get around to explaining the reset later”.
Stuart, the answer to your specific question is that the frame_geometry element is how metacity determines how far the decorations will extend beyond the basic window. If has_title is true, then the ‘top_height’ value is calculated as title_border.bottom+title_height+title_vertical_pad+title_border.top. If has_title is false, then ‘top_height’ is calculated as title_border.bottom + title_border.top (…I think; better check it yourself)
As for drawing button icons, I strongly recommend sticking to draw_ops for the shapes that can be drawn with them because they’re resolution independant and you can change all the colours to fit with the GTK theme (or colour-constants, if you’re using version-2 themes). If there’s a shape you can’t draw with draw_ops, you’ll have to use a PNG file (no point in using SVG files, see bug 561896).
I have a few changes I’d like to see in the Metacity theme format, but I suppose I should be filing wishlist bugs for them instead of complaining on a blog. :)
lostson: if an app isn’t remembering window positions then it’s a bug in the app. If the app doesn’t do it then you may want to investigate devilspie, which may do it for you, rather than metacity. I believe that’s the policy.
Screwtape: this is all exceedingly useful information! My plan was to wail enough that someone else built a wysiwyg editor, but hey ;-)
Plenty of people will disagree that every single app should have code that remembers window position. Maybe if there’s a way to add to metacity’s context menu devilspie can add something there.
Stuart so your telling me that gnome-terminal, firefox, gedit, and others should all remember their position when I close them ? and then always come back to the same spot ? If this were the case why would one need a window manager. All you really have then is a windowbar with a title on it then because its surely not managing anything then. And why would a application writer, write code into his app for this ? The window manager is supposed to place your apps(aka windows) on the desktop not the application. Now for applications that use a system tray icon yes definitely, when you send the application to the tray and then click on the tray icon to bring them back. That I can see being coded into the application. As far as Devilspie, its just another confusing tool to use that a user is gonna have to install after he finds out Metacity doesn’t do what they need it to do.
Several WM’s have this as a feature Fluxbox, E16, and KDE3 series. It is very helpful as far as I am concerned. For instance I probably open Evolution 15+ times a day and I would to always open in the same spot when I click on my mail-notification icon in the system tray, yet it does not. It always pops up in the left hand top corner. There are just some apps that you want in a certain spot all the time whether the app knows it or not.
Can metacity move the title bar from the tops of windows to the sides? This would help on small widescreen displays like the Eee PC (1024 x 600). wm2 does this: http://all-day-breakfast.com/wm2/ .
@Andrew Gaul:
Not in the current version of the theme format. It’d certainly be something that could be considered for a version 3, if anyone was interested in raising a bug.
Will Metacity ever support colour reactiveness?
@jamesh:
You want LAMPS?