Re: [PATCH wayland-protocols v4 1/7] xdg-shell: Turn xdg_surface into a generic base interface

2016-07-28 Thread Jonas Ådahl
I just landed 1-6 on the wip/xdg-shell-unstable-v6 branch (which was
also force-pushed after rebasing on top of the 1.5 release).

I will send a new series including an updated version of patch 7
clarifying some parts that Yong mentioned was unclear.


Jonas

On Fri, Jun 24, 2016 at 02:47:28PM +0800, Jonas Ådahl wrote:
> Split out toplevel window like requests and events into a new interface
> called xdg_toplevel, and turn xdg_surface into a generic base interface
> which others extends.
> 
> xdg_popup is changed to extend the xdg_surface.
> 
> The configure event in xdg_surface was split up making
> xdg_surface.configure an event only carrying the serial number, while a
> new xdg_toplevel.configure event carries the other data previously sent
> via xdg_surface.configure. xdg_toplevel.configure is made to extend,
> via the latch-state mechanism, xdg_surface.configure and depends on
> that event to synchronize state.
> 
> Other future xdg_surface based extensions are meant to also extend
> xdg_surface.configure for relevant window type dependend state
> synchronization.
> 
> Signed-off-by: Jonas Ådahl 
> Signed-off-by: Mike Blumenkrantz 
> Reviewed-by: Yong Bakos 
> ---
> 
> Changes since v3:
> 
>  - Clarify the requirements for a xdg_surface based surface to be mapped
>  - Reword the non-immediate effect of xdg_surface.configure
>  - Reword the explanation of a configure sequence
>  - Clarify that xdg_surface forms a basis for xdg_surface based surface roles
> 
>  unstable/xdg-shell/xdg-shell-unstable-v6.xml | 280 
> ---
>  1 file changed, 170 insertions(+), 110 deletions(-)
> 
> diff --git a/unstable/xdg-shell/xdg-shell-unstable-v6.xml 
> b/unstable/xdg-shell/xdg-shell-unstable-v6.xml
> index ce57153..3268077 100644
> --- a/unstable/xdg-shell/xdg-shell-unstable-v6.xml
> +++ b/unstable/xdg-shell/xdg-shell-unstable-v6.xml
> @@ -54,11 +54,14 @@
>  
>  
>
> - This creates an xdg_surface for the given surface and gives it the
> - xdg_surface role. A wl_surface can only be given an xdg_surface role
> - once. If get_xdg_surface is called with a wl_surface that already has
> - an active xdg_surface associated with it, or if it had any other role,
> - an error is raised.
> + This creates an xdg_surface for the given surface. While xdg_surface
> + itself is not a role, the corresponding surface may only be assigned
> + a role extending xdg_surface, such as xdg_toplevel or xdg_popup.
> +
> + This creates an xdg_surface for the given surface. An xdg_surface is
> + used as basis to define a role to a given surface, such as xdg_toplevel
> + or xdg_popup. It also manages functionality shared between xdg_surface
> + based surface roles.
>  
>   See the documentation of xdg_surface for more details about what an
>   xdg_surface is and how it is used.
> @@ -67,29 +70,6 @@
>
>  
>  
> -
> -  
> - This creates an xdg_popup for the given surface and gives it the
> - xdg_popup role. A wl_surface can only be given an xdg_popup role
> - once. If get_xdg_popup is called with a wl_surface that already has
> - an active xdg_popup associated with it, or if it had any other role,
> - an error is raised.
> -
> - This request must be used in response to some sort of user action
> - like a button press, key press, or touch down event.
> -
> - See the documentation of xdg_popup for more details about what an
> - xdg_popup is and how it is used.
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -
> -
>  
>
>   The ping event asks the client if it's still alive. Pass the
> @@ -117,13 +97,23 @@
>
>  
>
> -
> +
>An interface that may be implemented by a wl_surface, for
>implementations that provide a desktop-style user interface.
>  
> -  It provides requests to treat surfaces like windows, allowing to set
> -  properties like maximized, fullscreen, minimized, and to move and 
> resize
> -  them, and associate metadata like title and app id.
> +  It provides a base set of functionality required to construct user
> +  interface elements requiring management by the compositor, such as
> +  toplevel windows, menus, etc. The types of functionality are split into
> +  xdg_surface roles.
> +
> +  Creating an xdg_surface does not set the role for a wl_surface. In 
> order
> +  to map an xdg_surface, the client must create a role-specific object
> +  using, e.g., get_toplevel, get_popup. The wl_surface for any given
> +  xdg_surface can have at most one role, and may not be assigned any role
> +  not based on xdg_surface.
> +
> +  A role must be assigned before any other requests are made to the
> +  xdg_surface object.
>  
>The client must call wl_surface.commit on the corresponding wl_surface
> 

Re: [PATCH wayland-protocols v4 1/7] xdg-shell: Turn xdg_surface into a generic base interface

2016-07-20 Thread Quentin Glidic

On 24/06/2016 08:47, Jonas Ådahl wrote:

Split out toplevel window like requests and events into a new interface
called xdg_toplevel, and turn xdg_surface into a generic base interface
which others extends.

xdg_popup is changed to extend the xdg_surface.

The configure event in xdg_surface was split up making
xdg_surface.configure an event only carrying the serial number, while a
new xdg_toplevel.configure event carries the other data previously sent
via xdg_surface.configure. xdg_toplevel.configure is made to extend,
via the latch-state mechanism, xdg_surface.configure and depends on
that event to synchronize state.

Other future xdg_surface based extensions are meant to also extend
xdg_surface.configure for relevant window type dependend state
synchronization.

Signed-off-by: Jonas Ådahl 
Signed-off-by: Mike Blumenkrantz 
Reviewed-by: Yong Bakos 
---


Sounds good:
Acked-by: Quentin Glidic 

Cheers,




Changes since v3:

 - Clarify the requirements for a xdg_surface based surface to be mapped
 - Reword the non-immediate effect of xdg_surface.configure
 - Reword the explanation of a configure sequence
 - Clarify that xdg_surface forms a basis for xdg_surface based surface roles

 unstable/xdg-shell/xdg-shell-unstable-v6.xml | 280 ---
 1 file changed, 170 insertions(+), 110 deletions(-)

diff --git a/unstable/xdg-shell/xdg-shell-unstable-v6.xml 
b/unstable/xdg-shell/xdg-shell-unstable-v6.xml
index ce57153..3268077 100644
--- a/unstable/xdg-shell/xdg-shell-unstable-v6.xml
+++ b/unstable/xdg-shell/xdg-shell-unstable-v6.xml
@@ -54,11 +54,14 @@

 
   
-   This creates an xdg_surface for the given surface and gives it the
-   xdg_surface role. A wl_surface can only be given an xdg_surface role
-   once. If get_xdg_surface is called with a wl_surface that already has
-   an active xdg_surface associated with it, or if it had any other role,
-   an error is raised.
+   This creates an xdg_surface for the given surface. While xdg_surface
+   itself is not a role, the corresponding surface may only be assigned
+   a role extending xdg_surface, such as xdg_toplevel or xdg_popup.
+
+   This creates an xdg_surface for the given surface. An xdg_surface is
+   used as basis to define a role to a given surface, such as xdg_toplevel
+   or xdg_popup. It also manages functionality shared between xdg_surface
+   based surface roles.

See the documentation of xdg_surface for more details about what an
xdg_surface is and how it is used.
@@ -67,29 +70,6 @@
   
 

-
-  
-   This creates an xdg_popup for the given surface and gives it the
-   xdg_popup role. A wl_surface can only be given an xdg_popup role
-   once. If get_xdg_popup is called with a wl_surface that already has
-   an active xdg_popup associated with it, or if it had any other role,
-   an error is raised.
-
-   This request must be used in response to some sort of user action
-   like a button press, key press, or touch down event.
-
-   See the documentation of xdg_popup for more details about what an
-   xdg_popup is and how it is used.
-  
-  
-  
-  
-  
-  
-  
-  
-
-
 
   
The ping event asks the client if it's still alive. Pass the
@@ -117,13 +97,23 @@
   

   
-
+
   An interface that may be implemented by a wl_surface, for
   implementations that provide a desktop-style user interface.

-  It provides requests to treat surfaces like windows, allowing to set
-  properties like maximized, fullscreen, minimized, and to move and resize
-  them, and associate metadata like title and app id.
+  It provides a base set of functionality required to construct user
+  interface elements requiring management by the compositor, such as
+  toplevel windows, menus, etc. The types of functionality are split into
+  xdg_surface roles.
+
+  Creating an xdg_surface does not set the role for a wl_surface. In order
+  to map an xdg_surface, the client must create a role-specific object
+  using, e.g., get_toplevel, get_popup. The wl_surface for any given
+  xdg_surface can have at most one role, and may not be assigned any role
+  not based on xdg_surface.
+
+  A role must be assigned before any other requests are made to the
+  xdg_surface object.

   The client must call wl_surface.commit on the corresponding wl_surface
   for the xdg_surface state to take effect.
@@ -133,12 +123,147 @@
   manipulate a buffer prior to the first xdg_surface.configure call must
   also be treated as errors.

-  For a surface to be mapped by the compositor the client must have
-  committed both an xdg_surface state and a buffer.
+  For a surface to be mapped by the compositor, the following conditions

[PATCH wayland-protocols v4 1/7] xdg-shell: Turn xdg_surface into a generic base interface

2016-06-24 Thread Jonas Ådahl
Split out toplevel window like requests and events into a new interface
called xdg_toplevel, and turn xdg_surface into a generic base interface
which others extends.

xdg_popup is changed to extend the xdg_surface.

The configure event in xdg_surface was split up making
xdg_surface.configure an event only carrying the serial number, while a
new xdg_toplevel.configure event carries the other data previously sent
via xdg_surface.configure. xdg_toplevel.configure is made to extend,
via the latch-state mechanism, xdg_surface.configure and depends on
that event to synchronize state.

Other future xdg_surface based extensions are meant to also extend
xdg_surface.configure for relevant window type dependend state
synchronization.

Signed-off-by: Jonas Ådahl 
Signed-off-by: Mike Blumenkrantz 
Reviewed-by: Yong Bakos 
---

Changes since v3:

 - Clarify the requirements for a xdg_surface based surface to be mapped
 - Reword the non-immediate effect of xdg_surface.configure
 - Reword the explanation of a configure sequence
 - Clarify that xdg_surface forms a basis for xdg_surface based surface roles

 unstable/xdg-shell/xdg-shell-unstable-v6.xml | 280 ---
 1 file changed, 170 insertions(+), 110 deletions(-)

diff --git a/unstable/xdg-shell/xdg-shell-unstable-v6.xml 
b/unstable/xdg-shell/xdg-shell-unstable-v6.xml
index ce57153..3268077 100644
--- a/unstable/xdg-shell/xdg-shell-unstable-v6.xml
+++ b/unstable/xdg-shell/xdg-shell-unstable-v6.xml
@@ -54,11 +54,14 @@
 
 
   
-   This creates an xdg_surface for the given surface and gives it the
-   xdg_surface role. A wl_surface can only be given an xdg_surface role
-   once. If get_xdg_surface is called with a wl_surface that already has
-   an active xdg_surface associated with it, or if it had any other role,
-   an error is raised.
+   This creates an xdg_surface for the given surface. While xdg_surface
+   itself is not a role, the corresponding surface may only be assigned
+   a role extending xdg_surface, such as xdg_toplevel or xdg_popup.
+
+   This creates an xdg_surface for the given surface. An xdg_surface is
+   used as basis to define a role to a given surface, such as xdg_toplevel
+   or xdg_popup. It also manages functionality shared between xdg_surface
+   based surface roles.
 
See the documentation of xdg_surface for more details about what an
xdg_surface is and how it is used.
@@ -67,29 +70,6 @@
   
 
 
-
-  
-   This creates an xdg_popup for the given surface and gives it the
-   xdg_popup role. A wl_surface can only be given an xdg_popup role
-   once. If get_xdg_popup is called with a wl_surface that already has
-   an active xdg_popup associated with it, or if it had any other role,
-   an error is raised.
-
-   This request must be used in response to some sort of user action
-   like a button press, key press, or touch down event.
-
-   See the documentation of xdg_popup for more details about what an
-   xdg_popup is and how it is used.
-  
-  
-  
-  
-  
-  
-  
-  
-
-
 
   
The ping event asks the client if it's still alive. Pass the
@@ -117,13 +97,23 @@
   
 
   
-
+
   An interface that may be implemented by a wl_surface, for
   implementations that provide a desktop-style user interface.
 
-  It provides requests to treat surfaces like windows, allowing to set
-  properties like maximized, fullscreen, minimized, and to move and resize
-  them, and associate metadata like title and app id.
+  It provides a base set of functionality required to construct user
+  interface elements requiring management by the compositor, such as
+  toplevel windows, menus, etc. The types of functionality are split into
+  xdg_surface roles.
+
+  Creating an xdg_surface does not set the role for a wl_surface. In order
+  to map an xdg_surface, the client must create a role-specific object
+  using, e.g., get_toplevel, get_popup. The wl_surface for any given
+  xdg_surface can have at most one role, and may not be assigned any role
+  not based on xdg_surface.
+
+  A role must be assigned before any other requests are made to the
+  xdg_surface object.
 
   The client must call wl_surface.commit on the corresponding wl_surface
   for the xdg_surface state to take effect.
@@ -133,12 +123,147 @@
   manipulate a buffer prior to the first xdg_surface.configure call must
   also be treated as errors.
 
-  For a surface to be mapped by the compositor the client must have
-  committed both an xdg_surface state and a buffer.
+  For a surface to be mapped by the compositor, the following conditions
+  must be met: (1) the client has assigned a xdg_surface based role to the
+  surface, (2) the client has