_NET_WM_ALLOWED_ACTIONS



Hi,

Here's a patch to add the ALLOWED_ACTIONS feature, so tasklists/pagers
can properly gray out actions that aren't supported for a given
window.

I didn't put in any meaning for _NET_WM_ALLOWED_ACTIONS on map, since
it seems to present problems when switching window managers, and I'm
not sure why an app would want to override the standard actions
anyway. One exception is "close" - apps do know when close has been
disabled (when they are going to ignore delete messages) - but my
suggestion is that apps simply not set WM_DELETE_WINDOW in
WM_PROTOCOLS in this case.

I didn't put in RESIZE_HORZ/RESIZE_VERT or MOVE_HORZ/MOVE_VERT.  It
just doesn't seem useful - e.g. for resize, a window can be only
resizable in one direction, but chances are you wouldn't have this
exposed in the UI, i.e. you would have a Resize menu item but not a
Resize Horizontal menu item. Similar for move.

Comments?

Havoc

Index: wm-spec.sgml
===================================================================
RCS file: /home/freedesktop/wm-spec/wm-spec.sgml,v
retrieving revision 1.15
diff -u -p -u -r1.15 wm-spec.sgml
--- wm-spec.sgml	2001/10/17 12:43:02	1.15
+++ wm-spec.sgml	2001/10/17 13:13:16
@@ -16,7 +16,7 @@
 		<title>Version</title>
 		<para>
 This is DRAFT version 1.2 of the Extended Window Manager Hints (EWMH) spec,
-updated October 11 2001.
+updated October 17 2001.
 		</para>
 	</sect2>
 	<sect2>
@@ -741,7 +741,86 @@ _NET_WM_STATE_TOGGLE        2    /* togg
       <para>
 	See also the implementation notes on <link linkend="URGENCY">urgency</link> and <link linkend="NORESIZE">fixed size windows</link>.
 	</para>
-	</sect2><sect2><title>_NET_WM_STRUT</title>
+	</sect2>
+
+	<sect2>
+		<title>_NET_WM_ALLOWED_ACTIONS</title>
+		<programlisting><![CDATA[
+_NET_WM_ALLOWED_ACTIONS, ATOM[]
+]]></programlisting>
+		<para>
+A list of atoms indicating user operations that the window manager supports for
+this window. Atoms present in the list indicate allowed actions, atoms not
+present in the list indicate actions that are not supported for this window.
+The window manager MUST keep this property updated to reflect the 
+actions which are currently "active" or "sensitive" for a window.
+Taskbars, pagers, and other tools use _NET_WM_ALLOWED_ACTIONS to 
+decide which actions should be made available to the user.
+		</para>
+		<para>
+Possible atoms are:
+		</para>
+	<programlisting><![CDATA[
+_NET_WM_ACTION_MOVE, ATOM
+_NET_WM_ACTION_RESIZE, ATOM
+_NET_WM_ACTION_SHADE, ATOM
+_NET_WM_ACTION_STICK, ATOM
+_NET_WM_ACTION_MAXIMIZE_HORZ, ATOM
+_NET_WM_ACTION_MAXIMIZE_VERT, ATOM
+_NET_WM_ACTION_CHANGE_DESKTOP, ATOM
+_NET_WM_ACTION_CLOSE, ATOM
+]]></programlisting>
+      <para>
+An implementation MAY add new atoms to this list. Implementations
+without extensions MUST ignore any unknown atoms, effectively removing
+them from the list. These extension atoms MUST NOT start with the prefix
+_NET.
+      </para>
+      <para>
+Note that the actions listed here are those that the <emphasis>window
+manager</emphasis> will honor for this window. The operations must still be
+requested through the normal mechanisms outlined in this specification. For
+example, _NET_WM_ACTION_CLOSE does not mean that clients can send a
+WM_DELETE_WINDOW message to this window; it means that clients can use a
+_NET_CLOSE_WINDOW message to ask the window manager to do so.
+       </para>
+       <para>
+Window managers SHOULD ignore the value of _NET_WM_ALLOWED_ACTIONS when they 
+initially manage a window. This value may be left over from a previous window 
+manager with different policies.
+      </para>
+	<para>
+_NET_WM_ACTION_MOVE indicates that the window may be moved around the screen.
+	</para>
+	<para>
+_NET_WM_ACTION_RESIZE indicates that the window may be resized.
+(Implementation note: window managers can identify a non-resizable 
+window because its minimum and maximum size in WM_NORMAL_HINTS will be the same.)
+	</para>
+	<para>
+_NET_WM_ACTION_SHADE indicates that the window may be shaded.
+	</para>
+	<para>
+_NET_WM_ACTION_STICK indicates that the window may have its sticky state 
+toggled (as for _NET_WM_STATE_STICKY). Note that this state has to do with 
+viewports, not desktops.
+	</para>
+	<para>
+_NET_WM_ACTION_MAXIMIZE_HORZ indicates that the window may be maximized horizontally.
+	</para>
+	<para>
+_NET_WM_ACTION_MAXIMIZE_VERT indicates that the window may be maximized vertically.
+	</para>
+	<para>
+_NET_WM_ACTION_CHANGE_DESKTOP indicates that the window may be moved between desktops.
+	</para>
+	<para>
+_NET_WM_ACTION_CLOSE indicates that the window may be closed (i.e. a WM_DELETE_WINDOW 
+message may be sent).
+	</para>
+</sect2>
+
+<sect2><title>_NET_WM_STRUT</title>
 	<programlisting id="NETWMSTRUT"><![CDATA[
 _NET_WM_STRUT, left, right, top, bottom, CARDINAL[4]/32
 ]]></programlisting>
@@ -1249,6 +1328,9 @@ OR OTHER DEALINGS IN THE SOFTWARE.  
  			</para></listitem>
  			<listitem><para>
  Added _NET_WM_STATE_FULLSCREEN.
+ 			</para></listitem>
+ 			<listitem><para>
+ Added _NET_WM_ALLOWED_ACTIONS.
  			</para></listitem>
  	</itemizedlist>
  	</sect2>



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