Re: RFC: frame size hints



On Tue, 2003-12-16 at 13:25, Dominik Vogt wrote:
> On Tue, Dec 16, 2003 at 01:04:34PM -0500, Thomas Fitzsimmons wrote:
> > On Wed, 2003-12-10 at 07:03, Lubos Lunak wrote:
> > > On Wednesday 10 of December 2003 01:10, Rob Adams wrote:
> > > > Definitely should be "calculate".  Window managers implementing
> > > > approximations should document this is their respective COMPLIANCE
> > > > documents.
> > > 
> > >  I object. I hope the previous messages in the thread have shown that it can 
> > > be a major pain to always get it right, if it's actually possible at all. 
> > > KWin simply cannot calculate it, it can only estimate. Even Havoc said in one 
> > > message that the Metacity patch (which is the reference implementation for 
> > > this) is not guaranteed to get it right. And I said already, I'd actually 
> > > prefer if the wording stressed more the fact that it can be just a guess.
> > 
> > OK, I've rewritten the _NET_REQUEST_FRAME_EXTENTS section to emphasize
> > that its result is only an estimate and to incorporate Dominik's
> > suggestions.
> > 
> > Comments?
> 
> Okay, I think I could live with that, but ...
> 
> > +is a workable solution.  The extents estimation may depend on the
>                                 ^^^^^^^
> should be <extents'> ______________|
>                  ^^^
> 
> And then, why all these "should this" and "should that"?  Either
> the client or window manager does not implement this protocol.  In
> this case, the client should not have asked the WM in the first
> place (after checking some feature flag).  Or both support it, and
> both *must* honour the protocol exactly.
> 
> Finally, perhaps a note that the application *must* be able to
> cope with wrong estimates would be a good thing (e.g. in case the
> estimation changes before the client gets around mapping the
> window).
> 

Yup, all good suggestions.  Here's the new patch:

Index: wm-spec.xml
===================================================================
RCS file: /cvs/icccm-extensions/wm-spec/wm-spec.xml,v
retrieving revision 1.6
diff -u -r1.6 wm-spec.xml
--- wm-spec.xml	29 Jul 2003 18:08:38 -0000	1.6
+++ wm-spec.xml	16 Dec 2003 21:07:49 -0000
@@ -744,7 +744,36 @@
 	terminate the operation, e.g. by pressing the ESC key.  
         </para>
 	</sect2>
-	</sect1>	
+    <sect2><title>_NET_REQUEST_FRAME_EXTENTS</title>
+	<programlisting><![CDATA[
+_NET_REQUEST_FRAME_EXTENTS
+  window = window for which to set _NET_FRAME_EXTENTS
+  message_type = _NET_REQUEST_FRAME_EXTENTS
+]]></programlisting>
+	<para>
+A Client whose window has not yet been mapped can request of the
+Window Manager an estimate of the frame extents it will be given upon
+mapping.  To retrieve such an estimate, the Client MUST send a
+_NET_REQUEST_FRAME_EXTENTS message to the root window.  The Window
+Manager MUST respond by estimating the prospective frame extents and
+setting the window's _NET_FRAME_EXTENTS property accordingly.  The
+Client MUST handle the resulting _NET_FRAME_EXTENTS PropertyNotify
+event.  So that the Window Manager has a good basis for estimation,
+the Client MUST set any window properties it intends to set
+<i>before</i> sending this message.  The Client MUST be able to cope
+with imperfect estimates.
+	</para>
+	<para>
+Rationale: A client cannot calculate the dimensions of its window's
+frame before the window is mapped, but some toolkits need this
+information.  Asking the window manager for an estimate of the extents
+is a workable solution.  The estimate may depend on the current theme,
+font sizes or other window properties.  The client can track changes
+to the frame's dimensions by listening for _NET_FRAME_EXTENTS
+PropertyNotify events.
+	</para>
+	</sect2>
+</sect1>
 	<sect1>
 	<title>Application Window Properties</title>
 	<sect2><title>_NET_WM_NAME</title>
@@ -1298,6 +1327,16 @@
 event.
         </para>
     </sect2>
+	<sect2><title>_NET_FRAME_EXTENTS</title>
+	<programlisting><![CDATA[
+_NET_FRAME_EXTENTS, left, right, top, bottom, CARDINAL[4]/32
+]]></programlisting>
+	<para>
+The Window Manager MUST set _NET_FRAME_EXTENTS to the extents of the
+window's frame.  left, right, top and bottom are widths of the
+respective borders added by the Window Manager.
+	</para>
+	</sect2>
 </sect1>
 <sect1>
 	<title>Window Manager Protocols</title>
@@ -1792,6 +1831,7 @@
 		<para>David Rosenthal</para>
                 <para>Lubos Lunak</para>
                 <para>Rob Adams</para>
+                <para>Thomas Fitzsimmons</para>
 	</sect1>
   <sect1>
     <title>Change history</title>
@@ -1799,6 +1839,10 @@
  		<title>Changes since 1.2</title>
  		<itemizedlist>
  			<listitem><para>
+Added _NET_REQUEST_FRAME_EXTENTS and _NET_FRAME_EXTENTS to allow a
+client to retrieve its window's frame extents.
+ 			</para></listitem>
+ 			<listitem><para>
 Added new property _NET_WM_STRUT_PARTIAL to allow partial-width struts.
  			</para></listitem>
  			<listitem><para>





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]