[null, {"document_url": "https://blogs.gnome.org/metacity/category/nargery/ewmh/", "unformatted_src": "http://blogs.gnome.org/metacity/files/2007/12/feed.png", "src": "http://blogs.gnome.org/metacity/files/2007/12/feed.png", "formatted_filename": "feed"}, null, {"document_url": "https://blogs.gnome.org/metacity/category/nargery/ewmh/", "unformatted_src": "http://farm4.static.flickr.com/3240/3052925237_b9de98bc83.jpg", "src": "http://farm4.static.flickr.com/3240/3052925237_b9de98bc83.jpg", "formatted_filename": "b de bc", "alt_text": "Hanging", "rendered_width": 357, "rendered_height": 500}, null, {"document_url": "https://blogs.gnome.org/metacity/category/nargery/ewmh/", "unformatted_src": "http://farm1.static.flickr.com/20/69266030_013404532e.jpg", "src": "http://farm1.static.flickr.com/20/69266030_013404532e.jpg", "alt_text": "Two double-decker Routemaster buses, London", "rendered_width": 500, "rendered_height": 333}, null, null, null, {"document_url": "https://blogs.gnome.org/metacity/category/nargery/ewmh/", "unformatted_src": "http://farm4.static.flickr.com/3055/2628869994_087a85722c.jpg", "src": "http://farm4.static.flickr.com/3055/2628869994_087a85722c.jpg", "formatted_filename": "a c", "alt_text": "Dragon", "rendered_width": 500, "rendered_height": 333}, null, {"document_url": "https://blogs.gnome.org/metacity/category/nargery/ewmh/", "unformatted_src": "http://farm3.static.flickr.com/2148/2110838835_f7ee719e73.jpg", "src": "http://farm3.static.flickr.com/2148/2110838835_f7ee719e73.jpg", "formatted_filename": "f ee e", "alt_text": "Zarko Drincic - The Electric Bus (Awarded by National Geographic Magazine)", "rendered_width": 500, "rendered_height": 374}, null, {"document_url": "https://blogs.gnome.org/metacity/category/nargery/ewmh/", "unformatted_src": "http://farm3.static.flickr.com/2377/2148310522_575c9e2622.jpg", "src": "http://farm3.static.flickr.com/2377/2148310522_575c9e2622.jpg", "formatted_filename": "c e", "alt_text": "Fire Notifier", "rendered_width": 375, "rendered_height": 500}, null, {"document_url": "https://blogs.gnome.org/metacity/category/nargery/ewmh/", "unformatted_src": "http://farm1.static.flickr.com/96/239435850_1a6e489521.jpg", "src": "http://farm1.static.flickr.com/96/239435850_1a6e489521.jpg", "formatted_filename": "a e", "alt_text": "glass pane, shattered", "rendered_width": 500, "rendered_height": 375}, null, {"document_url": "https://blogs.gnome.org/metacity/category/nargery/ewmh/", "unformatted_src": "http://farm3.static.flickr.com/2017/2381590445_c22d38b597.jpg", "src": "http://farm3.static.flickr.com/2017/2381590445_c22d38b597.jpg", "formatted_filename": "c d b", "alt_text": "Kissing", "rendered_width": 500, "rendered_height": 375}, null, {"document_url": "https://blogs.gnome.org/metacity/category/nargery/ewmh/", "unformatted_src": "http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png", "src": "http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png", "alt_text": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported"}, null]


Photo © Glamhag, cc-by-nc-sa. 

Photo © Salim Virji, cc-by-sa. Some of the enhancements which have been suggested need some sort of hint to be set on windows.  For example, the recent squib about a special style for warning windows could only work if warning windows were marked in some way, and at present they’re not.  Similarly, drag and drop can only work better if the window manager is warned which clicks start a drag and which don’t.  This too will need a new hint.

There are two ways this can be done.  The simplest way is to use a hint whose name begins _METACITY; this doesn’t require us to talk to anyone.  It’s sometimes one way of starting the process of adding a feature like this.  Of course, it means that the feature’s unlikely ever to work with any other window manager.

The better and more extensible way is to make a new standard hint, one beginning _NET_WM.  This means adding the hint to the Extended Window Manager Hints standard (the EWMH).  Changing this standard means arguing it out on the wm-spec list.  The maintainers would like not to be the only ones to raise new ideas on this list.

In either case, the toolkits (such as GTK) will then need to be updated to mark the relevant windows with the relevant hints, and finally the applications will probably need to be updated to use the new functionality in the toolkits.  You can see, gentle reader, that enhancements like these are the source of more work than the average enhancement.  They may nevertheless be worth the effort.

This entry exists mainly so that we can link to it when the issue comes up.

Photo © !!sahrizvi!! (back in Dubai) !!, cc-by-nc-nd. 

Photo © Robin Gallagher, cc-by. In GNOME bug 80984 (closely related to GNOME bug 76672), someone is asking for the window manager to help out with drag-and-drop.  The problem is that a drag-and-drop operation should not raise the window it begins in, because raising that window could obscure the window you’re planning to drop the object into.

This is a reasonable and important request.  It is, however, not at all simple.  Metacity is the program which decides whether to raise the window, and there is currently no way for Metacity to know you’re about to start a drag-and-drop operation.

One rather crappy workaround is to tell it by holding down Super or AltGr.  This works, but it’s not elegant.  The system should be able to know.

This is not what raise_on_click does.  Please forget about raise_on_click.  It won’t solve your problem.

The correct answer is fixing this in the EWMH.  Luboš had an idea about this back in 2004 called _NET_WM_TAKE_ACTIVITY, and Elijah improved on this later with a more complicated idea called _NET_WM_MOUSE_ACTION.  Getting this into Metacity is GNOME bug 152952.  Whatever happens, it’s going to need changes to GTK and to various applications, particularly including Nautilus (the file manager).

Far more of a detailed writeup, including feedback from some of the people involved, is found in this entry. Your chronicler believes that implementing this is worth the fairly considerable effort to fix.

Photo © wili-hybrid, cc-by. GNOME bug 531512 suggests that Metacity should have a D-Bus interface.  On the face of it, this is a good idea.  However, the problem lies in the existing EWMH specification, which allows a program to request operations from a window manager– simply put, it’s pretty much exactly what a D-Bus interface would be, but it already exists.  If we also exposed a D-Bus interface, even one called “org.freedesktop.WM” instead of “org.gnome.Metacity”, we wouldn’t be gaining anything we don’t already have, and then people would begin using it and their programs wouldn’t be compatible with other EWMH window managers.  So every WM that implements the EWMH would have to expose the same D-Bus interface, which sounds like a lot of work for not much return.  On the other hand, we could have a separate program which exposed a D-Bus interface which translated the methods into EWMH messages, and which could be used with any EWMH window manager.  Would that do as well?  What do you think, gentle reader?

Photo copyright Zarko Drincic, cc-by-nd. Listen to this.

Launchpad bug 124326 requests a new titlebar button which minimises an application to the notification area rather than ordinary minimisation. Mostly this is currently done with the close button on the apps which support it, but some people feel it would be cleaner if these two functions were distinct. This action has been given the name “iconification” by some, but since this is the name the X specification gives to what we now call minimisation, I propose the ugly word “notifisation”.

There are four problems with this idea.

Photo by The Joy of the Mundane, cc-by-nc. Window matching is the process of identifying a new window as one we’ve seen before.  Of course every new window is new, and so we’ve never seen it before, but there’s an intuitive understanding that if you open a document in OpenOffice and then come back to it a week later that the window is in some way the same.

Some good properties to use for this are:

Metacity does not currently do window matching for three good reasons.

1. Separation of concerns: in-process or not?

The EWMH allows us to do window matching outside the WM, and in fact this is what Devil’s Pie and gdevilspie are for.  They have all the other problems, but they’re not part of the WM, and if they crash they don’t bring the WM down.  It appears that because this can be done outside the WM it should be.  (Isn’t this fun?  We can pretend we’re the Hurd.)  Feel free to argue the point, of course.

2. Separation of concerns: app or WM?

It is also possible that nobody except the application itself knows where its windows should be placed, and that everything should be left up to the apps (and in practice the toolkits).  This would allow us to do away with session management entirely.  Certainly it would mean that it was none of Metacity’s business.

3. Paucity of distinguishability: who sets what?

Devil’s Pie requires you to set up rules to identify windows.  Doing window matching at the window manager level implies that the rules are written for you automatically.  This wouldn’t be a problem, except that applications set the attributes above very inconsistently.  Although WM_NAME is always set, it isn’t necessarily reliable– for example, gedit adds a star to it when you begin editing a document. I believe therefore that we cannot use it in automated window matching.

As to the others, let’s introduce a notation: Role|Instance|Class.  If Role is missing, we write [NONE]|Instance|Class.  Here is a program called same.c which will print these values for you.  Some common examples:

Please feel free to comment with more results and I’ll add them.


Photo: Glass pane, shattered, © nchenga nchenga, cc-by-nc.

Quite often people ask whether Metacity can talk to you across D-BUS, or something similar.  It can’t.  There is no need for this, because you can do pretty much anything you want using X messages.  In particular, you can use messages from the EWMH specification to perform pretty much any task you might want, and there are some additional Metacity-specific ones (such as an instruction to change the theme).

If you want to play with a client which can send these messages, I recommend wmctrl.  Try installing it (it’s in most distros, I think), and then playing with it to see how you can

Read its source for all the details; it’s quite clearly laid out.