Re: Client messages _NET_WM_SHOW_WINDOW_MENU and _NET_WM_PERFORM_BUTTON_ACTION
Martin Gräßlin <[email protected]> Wed, 02 Jul 2014 09:54:57 +0200
| Newsgroups | gmane.comp.gnome.wm-spec |
|---|---|
| Message-ID | <1456999.RCszCl4jiL@martin-desktop> |
--===============4764376617428306099== Content-Type: multipart/signed; boundary="nextPart2481617.SbUEqDgTB7"; micalg="pgp-sha1"; protocol="application/pgp-signature" --nextPart2481617.SbUEqDgTB7 Content-Type: multipart/mixed; boundary="nextPart2176390.xtNrrb74lT" Content-Transfer-Encoding: quoted-printable This is a multi-part message in MIME format. =2D-nextPart2176390.xtNrrb74lT Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hi, I tried to incorporate the feedback and attached is a new version. My a= im is=20 to keep this extension simple, so that window managers are going to imp= lement=20 it. There is no use if that gets that complex, that nobody implements i= t ;-) Changes: * Added that in case a menu button is clicked also better suited values= should=20 be used, but not the complete rect added [1] * Renamed _NET_WM_PERFORM_BUTTON_ACTION to _NET_WM_TITLEBAR_ACTION * Made it more clear that _NET_WM_TITLEBAR_ACTION is about the title ba= r and=20 not about buttons * Made it more clear that it's up to the WM on how to react on the clie= nt=20 message including ignoring and that it's not the client's business what= =20 happens * Added special button value 0 to indicate a double click. Cheers Martin [1] If this is really needed I suggest to add another property which pr= ovides=20 the coordinates of the menu button to not carry it in the client messag= e. On Monday 30 June 2014 16:13:10 Martin Gr=C3=A4=C3=9Flin wrote: > Hi all, >=20 > attached are two patches for the NETWM spec. One message is to show t= he > window manager's window menu, the other is for passing the responsibi= lity > to perform a button action from the client to the window manager. For= > detailed information please have a look on the attached patches. >=20 > The need for these two client messages were derived by GTK+ and KWin > developers for better integrating GTK's new client-side-decorated win= dows in > environments which are not GNOME Shell. >=20 > KWin will add support for those two new hints and it looks like GTK+ = and > Mutter will also support them. >=20 > I would like to hear your feedback on them for inclusion into the NET= WM > spec. >=20 > Best Regards > Martin Gr=C3=A4=C3=9Flin =2D-nextPart2176390.xtNrrb74lT Content-Disposition: attachment; filename="0001-_NET_WM_SHOW_WINDOW_MENU.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="ISO-8859-1"; name="0001-_NET_WM_SHOW_WINDOW_MENU.patch" From=20f7f3007c7d7e0418d714cd0608bfa2638550f86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= <[email protected]> Date: Mon, 30 Jun 2014 15:34:57 +0200 Subject: [PATCH 1/2] _NET_WM_SHOW_WINDOW_MENU Adding a new client message _NET_WM_SHOW_WINDOW_MENU which can be used by Clients to show the window manager's window menu. The rational is to integrate Clients using client-side-decorations better into the environment they are running in. =2D-- wm-spec/wm-spec.xml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/wm-spec/wm-spec.xml b/wm-spec/wm-spec.xml index 0859dc6..8ee5315 100644 =2D-- a/wm-spec/wm-spec.xml +++ b/wm-spec/wm-spec.xml @@ -1789,6 +1789,37 @@ default positions. Note: The property is not used anywhere else besides being listed in _NET_SUPPORTED. </para> </sect2> + <sect2> + <title>_NET_WM_SHOW_WINDOW_MENU</title> + <para> +By including this hint in _NET_SUPPORTED the Window Manager announces +that it supports showing a menu offering window management options for a +given client. + </para> + <para> +A Client can request this menu by sending a _NET_WM_SHOW_WINDOW_MENU client message +to the root window: + </para> + <programlisting><![CDATA[ +_NET_WM_SHOW_WINDOW_MENU + message_type = _NET_WM_SHOW_WINDOW_MENU + window = window for which the menu should be shown + format = 32 + data.l[0] = xinput2_device_id + data.l[1] = root_x + data.l[2] = root_y + data.l[3] = timestamp + other data.l[] elements = 0 +]]></programlisting> + <para> +If the Xinput2 device which triggered the event does not provide coordinates (e.g. +triggered by a keyboard shortcut) the Client should set it to useful values the +window manager can use to position the menu. Also in case the click occurred in a +widget (e.g. a menu button) the coordinates should be set to useful values so that +the window manager can position the menu in an adjacent way. However it is up to +the window manager on how to position the menu. + </para> + </sect2> </sect1> <sect1> @@ -2305,6 +2336,9 @@ OR OTHER DEALINGS IN THE SOFTWARE. <title>Changes since 1.4draft</title> <itemizedlist> <listitem><para> +Added _NET_WM_SHOW_WINDOW_MENU + </para></listitem> + <listitem><para> Added _NET_WM_BYPASS_COMPOSITOR </para></listitem> <listitem><para> =2D- 2.0.0 =2D-nextPart2176390.xtNrrb74lT Content-Disposition: attachment; filename="0002-_NET_WM_TITLEBAR_ACTION.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="ISO-8859-1"; name="0002-_NET_WM_TITLEBAR_ACTION.patch" From=2002ecba2212baf99a00cd35be9025ec359bf5e777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= <[email protected]> Date: Mon, 30 Jun 2014 15:47:11 +0200 Subject: [PATCH 2/2] _NET_WM_TITLEBAR_ACTION Adding a new client message _NET_WM_TITLEBAR_ACTION which can be used by Clients to request the window manager to perform an action when a button is pressed on the title bar area of a window. The rational is to integrate Clients using client-side-decorations better into the environment they are running in. So instead of performing an action like raise/lower on middle click the task is delegated to the window manager. The window manager can then perform the same action as it does for windows it decorates. =2D-- wm-spec/wm-spec.xml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/wm-spec/wm-spec.xml b/wm-spec/wm-spec.xml index 8ee5315..1b683ea 100644 =2D-- a/wm-spec/wm-spec.xml +++ b/wm-spec/wm-spec.xml @@ -1820,6 +1820,44 @@ the window manager can position the menu in an adjacent way. However it is up to the window manager on how to position the menu. </para> </sect2> + <sect2> + <title>_NET_WM_TITLEBAR_ACTION</title> + <para> +By including this hint in _NET_SUPPORTED the Window Manager announces +that it supports performing pointer button specific events. For example a window +manager might raise or lower a Client when the decoration is middle clicked or show +a window menu on right click. A Client drawing it's own window decoration instead of +relying on the window manager provided decoration should use this client message +whenever the user clicked on the title bar area. However, the handling of left +mouse button to trigger move/resize mode must not be passed to the window manager +as the window manager cannot know in which areas a move or resize should be started. +Also widget areas like a close or maximize button must not be passed to the window +manager with this client message. Instead the appropriate action as described in this +specification should be used. + </para> + <para> +It is up to the window manager to decide which action to perform when receiving this +client message. An appropriate action is also to ignore the request. + </para> + <para> +A Client can request that the window manger should perform the appropriate action by +sending a _NET_WM_TITLEBAR_ACTION client message to the root window: + </para> + <programlisting><![CDATA[ +_NET_WM_TITLEBAR_ACTION + message_type = _NET_WM_TITLEBAR_ACTION + window = window for which the action should be performed + format = 32 + data.l[0] = xinput2_device_id + data.l[1] = root_x + data.l[2] = root_y + data.l[3] = button + data.l[4] = timestamp +]]></programlisting> + <para> +Button takes the special value of 0 which indicates a double click on the title bar area. + </para> + </sect2> </sect1> <sect1> @@ -2336,6 +2374,9 @@ OR OTHER DEALINGS IN THE SOFTWARE. <title>Changes since 1.4draft</title> <itemizedlist> <listitem><para> +Added _NET_WM_TITLEBAR_ACTION + </para></listitem> + <listitem><para> Added _NET_WM_SHOW_WINDOW_MENU </para></listitem> <listitem><para> =2D- 2.0.0 =2D-nextPart2176390.xtNrrb74lT-- This is a multi-part message in MIME format. --nextPart2176390.xtNrrb74lT Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hi, I tried to incorporate the feedback and attached is a new version. My a= im is=20 to keep this extension simple, so that window managers are going to imp= lement=20 it. There is no use if that gets that complex, that nobody implements i= t ;-) Changes: * Added that in case a menu button is clicked also better suited values= should=20 be used, but not the complete rect added [1] * Renamed _NET_WM_PERFORM_BUTTON_ACTION to _NET_WM_TITLEBAR_ACTION * Made it more clear that _NET_WM_TITLEBAR_ACTION is about the title ba= r and=20 not about buttons * Made it more clear that it's up to the WM on how to react on the clie= nt=20 message including ignoring and that it's not the client's business what= =20 happens * Added special button value 0 to indicate a double click. Cheers Martin [1] If this is really needed I suggest to add another property which pr= ovides=20 the coordinates of the menu button to not carry it in the client messag= e. On Monday 30 June 2014 16:13:10 Martin Gr=C3=A4=C3=9Flin wrote: > Hi all, >=20 > attached are two patches for the NETWM spec. One message is to show t= he > window manager's window menu, the other is for passing the responsibi= lity > to perform a button action from the client to the window manager. For= > detailed information please have a look on the attached patches. >=20 > The need for these two client messages were derived by GTK+ and KWin > developers for better integrating GTK's new client-side-decorated win= dows in > environments which are not GNOME Shell. >=20 > KWin will add support for those two new hints and it looks like GTK+ = and > Mutter will also support them. >=20 > I would like to hear your feedback on them for inclusion into the NET= WM > spec. >=20 > Best Regards > Martin Gr=C3=A4=C3=9Flin --nextPart2176390.xtNrrb74lT Content-Disposition: attachment; filename="0001-_NET_WM_SHOW_WINDOW_MENU.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="ISO-8859-1"; name="0001-_NET_WM_SHOW_WINDOW_MENU.patch" From f7f3007c7d7e0418d714cd0608bfa2638550f86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= <[email protected]> Date: Mon, 30 Jun 2014 15:34:57 +0200 Subject: [PATCH 1/2] _NET_WM_SHOW_WINDOW_MENU Adding a new client message _NET_WM_SHOW_WINDOW_MENU which can be used by Clients to show the window manager's window menu. The rational is to integrate Clients using client-side-decorations better into the environment they are running in. --- wm-spec/wm-spec.xml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/wm-spec/wm-spec.xml b/wm-spec/wm-spec.xml index 0859dc6..8ee5315 100644 --- a/wm-spec/wm-spec.xml +++ b/wm-spec/wm-spec.xml @@ -1789,6 +1789,37 @@ default positions. Note: The property is not used anywhere else besides being listed in _NET_SUPPORTED. </para> </sect2> + <sect2> + <title>_NET_WM_SHOW_WINDOW_MENU</title> + <para> +By including this hint in _NET_SUPPORTED the Window Manager announces +that it supports showing a menu offering window management options for a +given client. + </para> + <para> +A Client can request this menu by sending a _NET_WM_SHOW_WINDOW_MENU client message +to the root window: + </para> + <programlisting><![CDATA[ +_NET_WM_SHOW_WINDOW_MENU + message_type = _NET_WM_SHOW_WINDOW_MENU + window = window for which the menu should be shown + format = 32 + data.l[0] = xinput2_device_id + data.l[1] = root_x + data.l[2] = root_y + data.l[3] = timestamp + other data.l[] elements = 0 +]]></programlisting> + <para> +If the Xinput2 device which triggered the event does not provide coordinates (e.g. +triggered by a keyboard shortcut) the Client should set it to useful values the +window manager can use to position the menu. Also in case the click occurred in a +widget (e.g. a menu button) the coordinates should be set to useful values so that +the window manager can position the menu in an adjacent way. However it is up to +the window manager on how to position the menu. + </para> + </sect2> </sect1> <sect1> @@ -2305,6 +2336,9 @@ OR OTHER DEALINGS IN THE SOFTWARE. <title>Changes since 1.4draft</title> <itemizedlist> <listitem><para> +Added _NET_WM_SHOW_WINDOW_MENU + </para></listitem> + <listitem><para> Added _NET_WM_BYPASS_COMPOSITOR </para></listitem> <listitem><para> -- 2.0.0 --nextPart2176390.xtNrrb74lT Content-Disposition: attachment; filename="0002-_NET_WM_TITLEBAR_ACTION.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="ISO-8859-1"; name="0002-_NET_WM_TITLEBAR_ACTION.patch" From 02ecba2212baf99a00cd35be9025ec359bf5e777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= <[email protected]> Date: Mon, 30 Jun 2014 15:47:11 +0200 Subject: [PATCH 2/2] _NET_WM_TITLEBAR_ACTION Adding a new client message _NET_WM_TITLEBAR_ACTION which can be used by Clients to request the window manager to perform an action when a button is pressed on the title bar area of a window. The rational is to integrate Clients using client-side-decorations better into the environment they are running in. So instead of performing an action like raise/lower on middle click the task is delegated to the window manager. The window manager can then perform the same action as it does for windows it decorates. --- wm-spec/wm-spec.xml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/wm-spec/wm-spec.xml b/wm-spec/wm-spec.xml index 8ee5315..1b683ea 100644 --- a/wm-spec/wm-spec.xml +++ b/wm-spec/wm-spec.xml @@ -1820,6 +1820,44 @@ the window manager can position the menu in an adjacent way. However it is up to the window manager on how to position the menu. </para> </sect2> + <sect2> + <title>_NET_WM_TITLEBAR_ACTION</title> + <para> +By including this hint in _NET_SUPPORTED the Window Manager announces +that it supports performing pointer button specific events. For example a window +manager might raise or lower a Client when the decoration is middle clicked or show +a window menu on right click. A Client drawing it's own window decoration instead of +relying on the window manager provided decoration should use this client message +whenever the user clicked on the title bar area. However, the handling of left +mouse button to trigger move/resize mode must not be passed to the window manager +as the window manager cannot know in which areas a move or resize should be started. +Also widget areas like a close or maximize button must not be passed to the window +manager with this client message. Instead the appropriate action as described in this +specification should be used. + </para> + <para> +It is up to the window manager to decide which action to perform when receiving this +client message. An appropriate action is also to ignore the request. + </para> + <para> +A Client can request that the window manger should perform the appropriate action by +sending a _NET_WM_TITLEBAR_ACTION client message to the root window: + </para> + <programlisting><![CDATA[ +_NET_WM_TITLEBAR_ACTION + message_type = _NET_WM_TITLEBAR_ACTION + window = window for which the action should be performed + format = 32 + data.l[0] = xinput2_device_id + data.l[1] = root_x + data.l[2] = root_y + data.l[3] = button + data.l[4] = timestamp +]]></programlisting> + <para> +Button takes the special value of 0 which indicates a double click on the title bar area. + </para> + </sect2> </sect1> <sect1> @@ -2336,6 +2374,9 @@ OR OTHER DEALINGS IN THE SOFTWARE. <title>Changes since 1.4draft</title> <itemizedlist> <listitem><para> +Added _NET_WM_TITLEBAR_ACTION + </para></listitem> + <listitem><para> Added _NET_WM_SHOW_WINDOW_MENU </para></listitem> <listitem><para> -- 2.0.0 --nextPart2176390.xtNrrb74lT-- --nextPart2481617.SbUEqDgTB7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlOzutcACgkQqVXwidMiVrr9+wCeKWrHtsMbj3b1vQ3KUMiakU5K opQAoJbXdlCNIU/hegvRrokfUzQYCWLz =fcIJ -----END PGP SIGNATURE----- --nextPart2481617.SbUEqDgTB7-- --===============4764376617428306099== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ wm-spec-list mailing list [email protected] https://mail.gnome.org/mailman/listinfo/wm-spec-list --===============4764376617428306099==--