<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>…for the adult in you &#187; EWMH</title>
	<atom:link href="http://blogs.gnome.org/metacity/category/nargery/ewmh/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/metacity</link>
	<description>"Many window managers are like Marshmallow Froot Loops; Metacity is like Cheerios."</description>
	<lastBuildDate>Wed, 04 Nov 2009 10:59:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>		<item>
		<title>On enhancements which need changes to the EWMH</title>
		<link>http://blogs.gnome.org/metacity/2009/03/16/ewmh/</link>
		<comments>http://blogs.gnome.org/metacity/2009/03/16/ewmh/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 02:50:52 +0000</pubDate>
		<dc:creator>Thomas Thurman</dc:creator>
				<category><![CDATA[Bugs and issues]]></category>
		<category><![CDATA[EWMH]]></category>
		<category><![CDATA[Policy]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/?p=497</guid>
		<description><![CDATA[ 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&#8217;re not.  Similarly, drag and drop can only work better [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/sahrizvi/367604596/"><img src="http://farm1.static.flickr.com/180/367604596_1bef47b2b4.jpg?v=0" alt="" align="right" /></a> 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 href="http://blogs.gnome.org/metacity/2009/03/16/squib-of-the-day-special-frame-style-for-warning-dialogues/">a special style for warning windows</a> could only work if warning windows were marked in some way, and at present they&#8217;re not.  Similarly, <a href="http://blogs.gnome.org/metacity/2009/03/09/yes-dragon-drop-its-a-pun/">drag and drop</a> can only work better if the window manager is warned which clicks start a drag and which don&#8217;t.  This too will need a new hint.</p>
<p>There are two ways this can be done.  The simplest way is to use a hint whose name begins <strong>_METACITY</strong>; this doesn&#8217;t require us to talk to anyone.  It&#8217;s sometimes one way of starting the process of adding a feature like this.  Of course, it means that the feature&#8217;s unlikely ever to work with any other window manager.</p>
<p>The better and more extensible way is to make a new standard hint, one beginning <strong>_NET_WM</strong>.  This means adding the hint to the <a href="http://standards.freedesktop.org/wm-spec/wm-spec-latest.html">Extended Window Manager Hints</a> standard (the EWMH).  Changing this standard means arguing it out on <a href="http://mail.gnome.org/mailman/listinfo/wm-spec-list">the wm-spec list</a>.  The maintainers would like not to be the only ones to raise new ideas on this list.</p>
<p>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.</p>
<p>This entry exists mainly so that we can link to it when the issue comes up.</p>
<p><em>Photo © !!sahrizvi!! (back in Dubai) !!, cc-by-nc-nd.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2009/03/16/ewmh/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Squib of the day: Special frame style for warning dialogues</title>
		<link>http://blogs.gnome.org/metacity/2009/03/16/squib-of-the-day-special-frame-style-for-warning-dialogues/</link>
		<comments>http://blogs.gnome.org/metacity/2009/03/16/squib-of-the-day-special-frame-style-for-warning-dialogues/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 00:00:17 +0000</pubDate>
		<dc:creator>Thomas Thurman</dc:creator>
				<category><![CDATA[Bug of the day]]></category>
		<category><![CDATA[EWMH]]></category>
		<category><![CDATA[Themes v3]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/?p=475</guid>
		<description><![CDATA[ GNOME bug 102548 suggests that warning dialogues should have a special frame style, and it&#8217;s suggested that this could look like safety tape wrapped around the edge.
This is not unlike the special frame style suggested here for root windows.  However, while there&#8217;s already a way for the window manager to tell whether a window [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/robyn-gallagher/2426911381/"><img src="http://farm3.static.flickr.com/2081/2426911381_a55afef008.jpg?v=0" alt="" align="right" /></a> <a href='http://bugzilla.gnome.org/show_bug.cgi?id=102548' class='bug-link bug-link-gnome'>GNOME bug 102548</a> suggests that warning dialogues should have a special frame style, and it&#8217;s suggested that this could look like safety tape wrapped around the edge.</p>
<p>This is not unlike the special frame style <a href="http://blogs.gnome.org/metacity/2009/03/04/squib-of-the-day-as-root/#comment-810">suggested here</a> for root windows.  However, while there&#8217;s already a way for the window manager to tell whether a window belongs to the superuser, there&#8217;s currently no way to tell whether a window is a warning, so <a href="http://blogs.gnome.org/metacity/2009/03/16/ewmh/">this would need a change made to the EWMH</a> and then need all the toolkits fixing to use it.  It&#8217;s thus rather nontrivial, although it may still be worth it if it helps users.</p>
<p><a href="http://blogs.gnome.org/metacity/2009/03/05/policy-about-theme-versions/">Because this requires a change to the theme format, it must be committed first on a branch.</a></p>
<p>I am seriously entertaining the idea of doing away with the <em>window</em> and <em>frame_style_set</em> tags in v3 of the format, and just using tags on frame styles such as <em>maximized, shaded, focused, unfocused, root, warning, modal, </em>and so on, with some well-defined and intuitive rule about how to break ties:</p>
<p><tt>&lt;frame_style geometry="foo" <strong>tags="border focused maximized"&gt;</strong><br />
&lt;piece position="title"&gt;   ...</tt></p>
<p><em>Photo © Robin Gallagher, cc-by.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2009/03/16/squib-of-the-day-special-frame-style-for-warning-dialogues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Squib of the day: Drag and drop should work properly</title>
		<link>http://blogs.gnome.org/metacity/2009/03/09/yes-dragon-drop-its-a-pun/</link>
		<comments>http://blogs.gnome.org/metacity/2009/03/09/yes-dragon-drop-its-a-pun/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 00:00:16 +0000</pubDate>
		<dc:creator>Thomas Thurman</dc:creator>
				<category><![CDATA[Bug of the day]]></category>
		<category><![CDATA[EWMH]]></category>
		<category><![CDATA[Switching]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/?p=420</guid>
		<description><![CDATA[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&#8217;re planning to drop the object into.
This is [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Dragon by wili_hybrid, on Flickr" href="http://www.flickr.com/photos/wili/2628869994/"><img src="http://farm4.static.flickr.com/3055/2628869994_087a85722c.jpg" alt="Dragon" width="500" height="333" align="right" /></a>In  <a href='http://bugzilla.gnome.org/show_bug.cgi?id=80984' class='bug-link bug-link-gnome'>GNOME bug 80984</a> (closely related to  <a href='http://bugzilla.gnome.org/show_bug.cgi?id=76672' class='bug-link bug-link-gnome'>GNOME bug 76672</a>), 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&#8217;re planning to drop the object into.</p>
<p>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&#8217;re about to start a drag-and-drop operation.</p>
<p>One rather crappy workaround is to tell it by holding down <strong>Super</strong> or <strong>AltGr</strong>.  This works, but it&#8217;s not elegant.  The system should be able to <em>know</em>.</p>
<p>This is not what raise_on_click does.  Please forget about raise_on_click.  It won&#8217;t solve your problem.</p>
<p>The correct answer is <a href="http://blogs.gnome.org/metacity/2009/03/16/ewmh/">fixing this in the EWMH</a>.  Luboš had an idea about this back in 2004 called <a href="http://mail.gnome.org/archives/wm-spec-list/2004-April/msg00013.html"><strong>_NET_WM_TAKE_ACTIVITY</strong></a>, and Elijah improved on this later with a more complicated idea called <a href="http://mail.gnome.org/archives/wm-spec-list/2004-October/msg00008.html"><strong>_NET_WM_MOUSE_ACTION</strong></a>.  Getting this into Metacity is  <a href='http://bugzilla.gnome.org/show_bug.cgi?id=152952' class='bug-link bug-link-gnome'>GNOME bug 152952</a>.  Whatever happens, it&#8217;s going to need changes to GTK and to various applications, particularly including Nautilus (the file manager).</p>
<p><a href="http://blogs.gnome.org/metacity/2008/06/11/drag-and-drop/">Far more of a detailed writeup, including feedback from some of the people involved, is found in this entry.</a> Your chronicler believes that implementing this is worth the fairly considerable effort to fix.</p>
<p><em>Photo © wili-hybrid, cc-by.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2009/03/09/yes-dragon-drop-its-a-pun/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Metacity and D-Bus</title>
		<link>http://blogs.gnome.org/metacity/2009/01/24/metacity-and-d-bus/</link>
		<comments>http://blogs.gnome.org/metacity/2009/01/24/metacity-and-d-bus/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 21:14:08 +0000</pubDate>
		<dc:creator>Thomas Thurman</dc:creator>
				<category><![CDATA[EWMH]]></category>
		<category><![CDATA[Thought experiments]]></category>
		<category><![CDATA[nargery]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/?p=266</guid>
		<description><![CDATA[ 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&#8211; simply put, it&#8217;s pretty much exactly what a D-Bus interface would be, but [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Zarko Drincic - The Electric Bus (Awarded by National Geographic Magazine) by Zarko Drincic, on Flickr" href="http://www.flickr.com/photos/zarkodrincic/2110838835/"><img src="http://farm3.static.flickr.com/2148/2110838835_f7ee719e73.jpg" alt="Zarko Drincic - The Electric Bus (Awarded by National Geographic Magazine)" width="500" height="374" align="right" /></a> <a href='http://bugzilla.gnome.org/show_bug.cgi?id=531512' class='bug-link bug-link-gnome'>GNOME bug 531512</a> 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 <a href="http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html">EWMH specification</a>, which allows a program to request operations from a window manager&#8211; simply put, it&#8217;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 &#8220;org.freedesktop.WM&#8221; instead of &#8220;org.gnome.Metacity&#8221;, we wouldn&#8217;t be gaining anything we don&#8217;t already have, and then people would begin using it and their programs wouldn&#8217;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?</p>
<p><em>Photo copyright Zarko Drincic, cc-by-nd. </em></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2009/01/24/metacity-and-d-bus/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Notifisation</title>
		<link>http://blogs.gnome.org/metacity/2008/12/23/notifisation/</link>
		<comments>http://blogs.gnome.org/metacity/2008/12/23/notifisation/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 04:36:03 +0000</pubDate>
		<dc:creator>Thomas Thurman</dc:creator>
				<category><![CDATA[Bugs and issues]]></category>
		<category><![CDATA[EWMH]]></category>
		<category><![CDATA[Policy]]></category>
		<category><![CDATA[nargery]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/?p=220</guid>
		<description><![CDATA[
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 [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Fire Notifier by The Joy Of The Mundane, on Flickr" href="http://www.flickr.com/photos/mundane_joy/2148310522/"><img src="http://farm3.static.flickr.com/2377/2148310522_575c9e2622.jpg" alt="Fire Notifier" width="375" height="500" align="right" /></a></p>
<p align="right"><a href="http://marnanel.org/metacity/metacity-08-12-22b.mp3">Listen to this.</a></p>
<p> <a href='https://launchpad.net/bugs/124326' class='bug-link bug-link-launchpad'>Launchpad bug 124326</a> requests a new titlebar button which minimises an application <em>to the notification area</em> 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 &#8220;iconification&#8221; by some, but since this is the name the X specification gives to what we now call minimisation, I propose the ugly word &#8220;notifisation&#8221;.</p>
<p>There are four problems with this idea.</p>
<ol>
<li>Adding new titlebar buttons is always problematic for <a href="http://blogs.gnome.org/metacity/2008/12/22/extra-buttons/">reasons given earlier</a>.</li>
<li>The EWMH specification is going to have to include a way to tell which apps may be notifised, and a way for the WM to tell an app to notifise itself.  This is going to require arguing out on wm-spec-list.  In itself, this is not a major obstacle, but it&#8217;s important to be aware of.</li>
<li>It is unclear what the real difference between minimisation and notifisation is in practice.  And if there is one, why shouldn&#8217;t all apps be notifisable?</li>
<li>Using the notification area for things other than ephemeral notifications&#8211; that is, using it as a cheap way to make panel applets&#8211; is contrary to the Human Interface Guidelines.  Perhaps the HIG is wrong, but then we need careful thought before we give the practice a stamp of approval by enshrining it in the EWMH.  Besides, there is talk of <a href="http://www.markshuttleworth.com/archives/253">enforcing notification ephemerality</a>.</li>
</ol>
<p><em>Photo by The Joy of the Mundane, cc-by-nc.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2008/12/23/notifisation/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
<enclosure url="http://marnanel.org/metacity/metacity-08-12-22b.mp3" length="1374336" type="audio/mpeg" />
		</item>
		<item>
		<title>Window matching</title>
		<link>http://blogs.gnome.org/metacity/2008/11/02/window-matching/</link>
		<comments>http://blogs.gnome.org/metacity/2008/11/02/window-matching/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 18:30:37 +0000</pubDate>
		<dc:creator>Thomas Thurman</dc:creator>
				<category><![CDATA[Bugs and issues]]></category>
		<category><![CDATA[EWMH]]></category>
		<category><![CDATA[ICCCM]]></category>
		<category><![CDATA[nargery]]></category>
		<category><![CDATA[overview]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/?p=171</guid>
		<description><![CDATA[Window matching is the process of identifying a new window as one we&#8217;ve seen before.  Of course every new window is new, and so we&#8217;ve never seen it before, but there&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/chiperoni/239435850/" title="glass pane, shattered by nchenga, on Flickr"><img src="http://farm1.static.flickr.com/96/239435850_1a6e489521.jpg" width="500" height="375" alt="glass pane, shattered" align="right" /></a>Window matching is the process of identifying a new window as one we&#8217;ve seen before.  Of course every new window is <em>new</em>, and so we&#8217;ve never seen it before, but there&#8217;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.</p>
<p>Some good properties to use for this are:</p>
<ul>
<li><a href="http://ring.u-toyama.ac.jp/pub/XFree86/4.1.0/doc/xsmp.TXT"><em>SM_CLIENT_ID</em></a>, which is set by the session manager for a particular instance of a running program. XSMP says that &#8220;a unique value called a client-ID is provided by the protocol for the purpose of disambiguating multiple instantiations of clients.&#8221;</li>
<li><a href="http://tronche.com/gui/x/icccm/sec-5.html"><em>WM_WINDOW_ROLE</em></a>, which is optional.  The ICCCM says that &#8220;the combination of SM_CLIENT_ID and WM_WINDOW_ROLE can be used by other clients to uniquely identify a window across sessions.&#8221;  If there is no WM_WINDOW_ROLE, the ICCCM tells us to fall back on WM_CLASS and WM_NAME&#8230;</li>
<li><em>WM_NAME</em> is the window title.</li>
<li><a href="http://tronche.com/gui/x/icccm/sec-4.html"><em>WM_CLASS</em></a> is a two-part property.  Let&#8217;s call these Instance and Class, although these aren&#8217;t the real names. <em>Instance</em> is generally the name of the program, although it can sometimes be set on the commandline.</li>
<li><em>Class</em> is &#8220;the general class of applications to which the client  that owns this window belongs&#8221;, i.e. the brand name of the program (rather than &#8220;editor&#8221;).</li>
</ul>
<p>Metacity does not currently do window matching for three good reasons.</p>
<p><strong>1. Separation of concerns: in-process or not?</strong></p>
<p>The EWMH allows us to do window matching outside the WM, and in fact this is what <a href="http://burtonini.com/blog/computers/devilspie">Devil&#8217;s Pie</a> and <a href="http://www.phaeronix.net/gDevilspie">gdevilspie</a> are for.  They have all the other problems, but they&#8217;re not part of the WM, and if they crash they don&#8217;t bring the WM down.  It appears that because this can be done outside the WM it should be.  (Isn&#8217;t this fun?  We can pretend we&#8217;re the Hurd.)  Feel free to argue the point, of course.</p>
<p><strong>2. Separation of concerns: app or WM?</strong></p>
<p>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&#8217;s business.</p>
<p><strong>3. Paucity of distinguishability: who sets what?</strong></p>
<p>Devil&#8217;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&#8217;t be a problem, except that applications set the attributes above very inconsistently.  Although WM_NAME is always set, it isn&#8217;t necessarily reliable&#8211; 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.</p>
<p>As to the others, let&#8217;s introduce a notation: <strong>Role|Instance|Class</strong>.  If Role is missing, we write <strong>[NONE]|Instance|Class</strong>.  Here is a program called <a href="http://www.gnome.org/~tthurman/bugs/same.c">same.c</a> which will print these values for you.  Some common examples:</p>
<ul>
<li>Firefox sets <strong>browser|Navigator|Firefox</strong> in all cases.  It is therefore not possible to distinguish Firefox windows from one another except by WM_NAME.</li>
<li>Thunderbird sets <strong>[NONE]|gecko|Thunderbird-bin</strong>, but it usually only has one window open.</li>
<li>nautilus sets <strong>[NONE]|nautilus|Nautilus</strong> and it is therefore impossible to tell the difference between Nautilus windows except by WM_NAME.</li>
<li>inkscape sets <strong>[NONE]|inkscape|Inkscape</strong> similarly.</li>
<li>gnome-calculator sets <strong>[NONE]|gnome-calculator|Gnome-calculator</strong>.</li>
<li>gnome-terminal sets <strong>gnome-terminal-</strong><em>SOME-LONG-STRING-OF-NUMBERS</em><strong>|gnome-terminal|Gnome-terminal</strong> with the string of numbers different each time.  This gets an A.</li>
<li>epiphany sets <strong>epiphany-window-</strong><em>SOME-LONG-STRING-OF-NUMBERS</em><strong>|epiphany-browser|Epiphany-browser</strong> with the numbers differing.  Another A.</li>
<li>The GIMP sets <strong>gimp-</strong><em>XXX</em><strong>|gimp|Gimp</strong> where <em>XXX</em> is &#8220;toolbox&#8221;, &#8220;dock&#8221;, &#8220;tip-of-the-day&#8221;, etc.  This gets an A+.</li>
</ul>
<p>Please feel free to comment with more results and I&#8217;ll add them.</p>
<p><strong>Conclusion</strong></p>
<ul>
<li>People often complain that Metacity doesn&#8217;t do window matching.</li>
<li>There are many reasons why it shouldn&#8217;t (but feel free to disagree in comments).</li>
<li>Window matching of any kind is needlessly difficult because the important properties are set inconsistently.</li>
<li>Therefore for the sake of window matching in general, whether we do it in Metacity or not, it would be a useful exercise to patch all programs which don&#8217;t set roles as well as the GIMP does.  (<a href="http://library.gnome.org/devel/gtk/2.12/GtkWindow.html#gtk-window-set-role">gtk_window_set_role()</a> is the relevant GTK function; <a href="http://www.google.com/codesearch?q=gtk_window_set_role+-package%3Agtk%2B">it&#8217;s not widely used</a>.)  Perhaps this could become a <a href="http://live.gnome.org/GnomeGoals">GNOME Goal</a>.</li>
</ul>
<p><small>Photo: Glass pane, shattered, &copy; nchenga nchenga, cc-by-nc.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2008/11/02/window-matching/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Communicating with Metacity</title>
		<link>http://blogs.gnome.org/metacity/2008/08/15/communicating-with-metacity/</link>
		<comments>http://blogs.gnome.org/metacity/2008/08/15/communicating-with-metacity/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 11:54:21 +0000</pubDate>
		<dc:creator>Thomas Thurman</dc:creator>
				<category><![CDATA[EWMH]]></category>
		<category><![CDATA[nargery]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/2008/08/15/communicating-with-metacity/</guid>
		<description><![CDATA[Quite often people ask whether Metacity can talk to you across D-BUS, or something similar.  It can&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p>Quite often people ask whether Metacity can talk to you across D-BUS, or something similar.  It can&#8217;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 <a href="http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html">the EWMH specification</a> 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).</p>
<p>If you want to play with a client which can send these messages, I recommend <a href="http://www.sweb.cz/tripie/utils/wmctrl/">wmctrl</a>.  Try installing it (it&#8217;s in most distros, I think), and then playing with it to see how you can</p>
<ul>
<li>switch desktops</li>
<li>bring a window to a desktop</li>
<li>resize a window</li>
<li>maximise a window</li>
<li>minimise all windows</li>
<li>list all windows</li>
<li>rename a window</li>
<li>&#8230; and so on.</li>
</ul>
<p>Read its source for all the details; it&#8217;s quite clearly laid out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2008/08/15/communicating-with-metacity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If the user will not come to the window, the window shall come to the user</title>
		<link>http://blogs.gnome.org/metacity/2008/07/22/dona-nobis-pacem/</link>
		<comments>http://blogs.gnome.org/metacity/2008/07/22/dona-nobis-pacem/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 02:50:01 +0000</pubDate>
		<dc:creator>Thomas Thurman</dc:creator>
				<category><![CDATA[Bugs and issues]]></category>
		<category><![CDATA[EWMH]]></category>
		<category><![CDATA[Policy]]></category>
		<category><![CDATA[Switching]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/2008/07/22/dona-nobis-pacem/</guid>
		<description><![CDATA[Suppose you have two workspaces, and a window on each one.  You&#8217;re looking at window A, so clearly window B is offscreen. You click something on window A, and window A attempts to present window B to you.  What does that mean?
Let&#8217;s have two concrete examples:

0&#215;01: You&#8217;ve clicked a link in Pidgin&#8217;s buddy [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/rofanator/2381590445/" title="Kissing by rofanator, on Flickr"><img src="http://farm3.static.flickr.com/2017/2381590445_c22d38b597.jpg" alt="Kissing" align="right" height="375" width="500" /></a>Suppose you have two workspaces, and a window on each one.  You&#8217;re looking at window <em>A</em>, so clearly window <em>B</em> is offscreen. You click something on window <em>A</em>, and window <em>A</em> attempts to <strong>present</strong> window <em>B</em> to you.  What does that mean?</p>
<p>Let&#8217;s have two concrete examples:</p>
<ul>
<li>0&#215;01: You&#8217;ve clicked a link in Pidgin&#8217;s buddy window,  and it&#8217;s attempting to present the chat window to you.</li>
<li>0&#215;02: You&#8217;ve clicked a link in Evolution, and it&#8217;s attempting to present Firefox to you.</li>
</ul>
<p>In 0&#215;01, you want to stop looking at the old workspace and look at the new one.  But you don&#8217;t want the windows to move off their workspaces.  You want everything to stay where it is.</p>
<p>This is the way upstream Metacity currently works throughout.  However, since Firefox is a tabbed browser,((I know Firefox has had tabs since 2002)) people have been asking whether this is the wisest course all the time.  In case 0&#215;02 above, in the old days, the browser would just have launched a new window in your workspace.  People don&#8217;t like that now, because they want all their tabs in the same window.  But if the user gets shoved onto the workspace of the existing window and then we add a new tab, eventually they&#8217;ll close it and then wonder where their mail went. (At least, that&#8217;s how I understand their argument; perhaps I&#8217;m mistaken.)  As a compromise, downstream Metacity has now been patched in Ubuntu, Fedora, and possibly other places to make the window demand attention when this happens (i.e. go pulsy on the taskbar).</p>
<p>So we have multiple options when this happens:</p>
<ul>
<li>Bring the window to the user, always.</li>
<li>Bring the user to the window, always.  (This is what we do now.)</li>
<li>Make the window demand attention&#8211; in other words, apply the downstream patch.  This is not the path of least resistance, since judging by recent feedback it appears to really annoy anyone using, say, Pidgin.</li>
<li>Tell the target application to deal with it.  This would mean that Firefox could open a new window if you were on a workspace where it had no windows open and open a new tab if you were on a workspace where it had one already.  It would mean finding some way of dealing with windows that didn&#8217;t co-operate.  It would also mean, alone among all these solutions, that we&#8217;d have to find a way of communicating with the target application.</li>
<li>Ask the summoning application to give us a hint as to which of these it would like.  This is my (Thomas&#8217;s) favourite solution.  It will need a change to the EWMH.</li>
</ul>
<p>Things which are not solutions:</p>
<ul>
<li>Allowing the user to pick one and then requiring them to stick with it.  As Havoc said, this is basically giving them a choice between &#8220;break Pidgin&#8221; and &#8220;break Firefox&#8221;.</li>
<li>Window matching.  <a href="http://blogs.gnome.org/metacity/2008/03/08/session-management/">We <em>do not do window matching</em>.</a>  We are not about to start for an issue as small as this.  That&#8217;s what devilspie is for.</li>
</ul>
<p>Want to join in the <strike>argument</strike> fun?  Dive in at  <a href='http://bugzilla.gnome.org/show_bug.cgi?id=482354' class='bug-link bug-link-gnome'>GNOME bug 482354</a>.  The water&#8217;s lovely.</p>
<p><small>Photo credit: rofanator.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2008/07/22/dona-nobis-pacem/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>The overview series: Drag and drop.  You complain, we explain.</title>
		<link>http://blogs.gnome.org/metacity/2008/06/11/drag-and-drop/</link>
		<comments>http://blogs.gnome.org/metacity/2008/06/11/drag-and-drop/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 16:55:35 +0000</pubDate>
		<dc:creator>Thomas Thurman</dc:creator>
				<category><![CDATA[Bugs and issues]]></category>
		<category><![CDATA[EWMH]]></category>
		<category><![CDATA[nargery]]></category>
		<category><![CDATA[overview]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/2008/06/11/drag-and-drop/</guid>
		<description><![CDATA[If there are two overlapping windows on the screen, people would like to be able to pick up an object from the lower window and drag it to the upper without bringing the lower window to the front, because if that happens the lower window will obscure the upper, and you won&#8217;t have anywhere to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/pbo31/399537401/" title="drag on by pbo31, on Flickr"><img src="http://farm1.static.flickr.com/174/399537401_4b5d1e3316.jpg" alt="drag on" align="right" width="500" height="375" /></a>If there are two overlapping windows on the screen, <a href="http://brainstorm.ubuntu.com/idea/2567/">people</a> would <a href="http://brainstorm.ubuntu.com/idea/3490/">like</a> to be able to pick up an object from the lower window and drag it to the upper without bringing the lower window to the front, because if that happens the lower window will obscure the upper, and you won&#8217;t have anywhere to drag to.  In this instance, we would like the same behaviour as Microsoft Windows: if the click starts a drag, raise the lower window on button <em>release</em>; if it doesn&#8217;t, raise the window on button press as normal.</p>
<p>However, Metacity (along with most other window managers) doesn&#8217;t currently do this, for want of a way to know whether the click starts a drag.  This is really something that only the application owning that window can tell us.  (It is possible for the <em>user</em> to tell us what they think, by holding down AltGr at the start of the drag.  That may not be an official feature. It&#8217;s not really ideal either way.)</p>
<p>This whole question is something we&#8217;ve been batting around <a href="http://mail.gnome.org/archives/wm-spec-list/2002-August/msg00032.html">for six years now</a> and it probably ought to be fixed one way or another.  Over that time, there are also a few other reasons people have asked to be able to pick stuff up from lower windows, such as the ability to copy text from the lower window and paste it into the upper, or scrolling the lower window&#8217;s scrollbars : <a href='http://bugzilla.gnome.org/show_bug.cgi?id=76672' class='bug-link bug-link-gnome'>GNOME bug 76672</a> deals with this more general case, which we shan&#8217;t discuss further here now.  Let&#8217;s concentrate on the most common problem, represented by  <a href='http://bugzilla.gnome.org/show_bug.cgi?id=80984' class='bug-link bug-link-gnome'>GNOME bug 80984</a>: not raising the source window when a drag and drop begins.  What <em>isn&#8217;t</em> a solution to our problem?</p>
<p><strong>What <em>isn&#8217;t</em> a solution</strong></p>
<ul>
<li><strong>Always raising the lower window only on release, not on click</strong> (suggested by many people).  This would solve the problem at the cost of weirding everyone out, not just breaking the expectations of existing Metacity users and users from other window managers in the world of free software, but also the expectations of Mac and Windows people.</li>
<li><strong>Only raising a window when you click on the frame and not the insides</strong>, which was raised in  <a href='http://bugzilla.gnome.org/show_bug.cgi?id=86108' class='bug-link bug-link-gnome'>GNOME bug 86108</a>.  This is a bad idea for similar reasons to the last.</li>
<li>Having a <strong>magic kind of window that Metacity promises never to raise</strong>; then the client will decide whether to raise itself or not based on whether the click was the start of a drag operation. This is how Sawfish does or did it.  It&#8217;s a bad idea because it rather defeats the purpose of having a window manager if clients are going to manage their own windows, and besides <a href="http://blogs.gnome.org/metacity/2007/12/24/stacking/">applications can&#8217;t raise their own windows in Metacity</a> anyway.</li>
</ul>
<p><strong>What <em>is</em> a solution</strong><br />
What needs to happen is this:</p>
<ol>
<li>We figure out a way for other clients to tell the window manager that a click in their window was the start of some kind of drag-and-drop operation.</li>
<li>At this point, the fact that Metacity doesn&#8217;t understand this message suddenly becomes a bug in Metacity.  So we fix the window manager to understand this.</li>
<li>At this point, the fact that none of the applications out there understand how to tell Metacity about this becomes a bug in those applications, but we can&#8217;t do anything much about it without fixing the toolkits like GTK.  So we do that.</li>
<li>Now we can actually fix all the applications separately.  The bug for fixing Nautilus at this point is  <a href='http://bugzilla.gnome.org/show_bug.cgi?id=132339' class='bug-link bug-link-gnome'>GNOME bug 132339</a>.</li>
</ol>
<p>Clearly we can&#8217;t get 2, 3, and 4 sorted until we have 1 down, so let&#8217;s just talk about that for the moment.  Back in 2004, Lubos Lunak (the maintainer of KDE&#8217;s window manager) proposed the first plan to do this, called <strong><a href="http://mail.gnome.org/archives/wm-spec-list/2004-April/msg00013.html">_NET_WM_TAKE_ACTIVITY</a></strong> (a misleading name, since it&#8217;s about taking focus and not activity). When a window other than the topmost one was clicked, the window manager would send it _NET_WM_TAKE_ACTIVITY, which it would remember; after that, nothing would happen until the button was released.  If the click had actually begun a drag-and-drop operation, that was all well and good, but if it hadn&#8217;t, the client should send it on to the root window and the window manager would raise the window after all.  In  <a href='http://bugzilla.gnome.org/show_bug.cgi?id=152952' class='bug-link bug-link-gnome'>GNOME bug 152952</a>, Elijah Newren wrote a patch for Metacity implementing this plan.</p>
<p>Lubos&#8217;s original plan had a few infelicities, some of which were discussed <a href="http://www.gtk.org/plan/meetings/20041005.txt">in this meeting</a>.  It means that the window is raised when you release the mouse button, which is bad for reasons we discussed above.  It also means that a lot of policy is decided ahead of time: for example, <a href="http://mail.gnome.org/archives/wm-spec-list/2004-October/msg00008.html">some people would like</a> their window manager to raise the lower window while they were copying text from it, and then drop it back down when they were done, but not do the same thing for drag-and-drop.  There was working code for KDE and GNOME, but many people objected about all the problems mentioned above including the GTK hackers.  In the end it didn&#8217;t make it into the EWMH standard, although some parts of the KDE libraries appear still to accept it to some extent.</p>
<p>Elijah then proposed to fix the problem with a new message type called <strong><a href="http://mail.gnome.org/archives/wm-spec-list/2004-October/msg00014.html">_NET_WM_MOUSE_ACTION</a></strong>. With this plan, a client would send _NET_WM_MOUSE_ACTION through to the root window as soon as <em>any</em> button was pressed or released on it, telling the window manager what kind of action the click meant: it could be &#8220;nothing special&#8221; or &#8220;drag-and-drop&#8221;, but also &#8220;text selection&#8221; or &#8220;scrollbar drag&#8221; or &#8220;generic thing that I don&#8217;t want to explain right now but involves not raising me&#8221;.  Lubos <a href="http://mail.gnome.org/archives/wm-spec-list/2004-October/msg00018.html">agreed that this was a better plan</a>, but it died even earlier in committee, and as far as I know was never implemented anywhere.</p>
<p>It seems to me that the best thing to do, if we can, is to go with a partial fix using _NET_WM_MOUSE_ACTION which allows us to heal this obvious problem.  Then we can carry on later and fix specific problems.  <a href="http://mail.gnome.org/archives/usability/2005-October/msg00084.html">Elijah has said</a> that _NET_WM_MOUSE_ACTION needed a great deal of work to implement on the GTK side; the closest thing we have so far to working code is <a href="http://bugzilla.gnome.org/show_bug.cgi?id=154260#c28">a patch he then posted</a>.  This does still need working on, preferably by someone who understands the internals of GDK (could this be you, gentle reader?).</p>
<p>A similar but not identical problem is the issue of <em>raising</em> windows when they are a drag <em>target</em>; this is covered in  <a href='http://bugzilla.gnome.org/show_bug.cgi?id=112308' class='bug-link bug-link-gnome'>GNOME bug 112308</a>.</p>
<p>Next in the overview series: why getting stacking exactly right is hard and what we&#8217;re going to do about it.</p>
<p><small>Photo by pbo31, cc-by-nc-nd.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2008/06/11/drag-and-drop/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>
