<div dir="ltr"><div>Some framework-y applications have multiple apps in one process, like LibreOffice. There's also the Chrome / Firefox "web apps" system where you can launch Chrome / Firefox with a URL as if the web apps were native native.<br><br>Perhaps they should create a new xdg_shell for every app they create? I don't know how difficult that would be for them to do.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 1, 2014 at 1:35 AM, Giulio Camuffo <span dir="ltr"><<a href="mailto:giuliocamuffo@gmail.com" target="_blank">giuliocamuffo@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">2014-11-22 22:28 GMT+02:00 Jasper St. Pierre <<a href="mailto:jstpierre@mecheye.net">jstpierre@mecheye.net</a>>:<br>
> This rewrites basically all of the text inside xdg-shell to be up to<br>
> date, clearer, and rid of wl_shell and X11 terminology.<br>
> ---<br>
> protocol/xdg-shell.xml | 256 ++++++++++++++++++++++++++++++-------------------<br>
> 1 file changed, 156 insertions(+), 100 deletions(-)<br>
><br>
> diff --git a/protocol/xdg-shell.xml b/protocol/xdg-shell.xml<br>
> index 360179d..3359cf7 100644<br>
> --- a/protocol/xdg-shell.xml<br>
> +++ b/protocol/xdg-shell.xml<br>
> @@ -31,11 +31,15 @@<br>
><br>
> <interface name="xdg_shell" version="1"><br>
> <description summary="create desktop-style surfaces"><br>
> - This interface is implemented by servers that provide<br>
> - desktop-style user interfaces.<br>
> -<br>
> - It allows clients to associate a xdg_surface with<br>
> - a basic surface.<br>
> + xdg_shell allows clients to turn a wl_surface into a "real window"<br>
> + which can be dragged, resized, stacked, and moved around by the<br>
> + user. Everything about this interface is suited towards traditional<br>
> + desktop environments.<br>
> +<br>
> + Destroying a bound xdg_shell object while there are surfaces<br>
> + still alive with roles from this interface is illegal and will<br>
> + result in a protocol error. Make sure to destroy all surfaces<br>
> + before destroying this object.<br>
> </description><br>
><br>
> <enum name="version"><br>
> @@ -65,33 +69,26 @@<br>
><br>
> <request name="get_xdg_surface"><br>
> <description summary="create a shell surface from a surface"><br>
> - Create a shell surface for an existing surface.<br>
> -<br>
> - This request gives the surface the role of xdg_surface. If the<br>
> - surface already has another role, it raises a protocol error.<br>
> -<br>
> - Only one shell or popup surface can be associated with a given<br>
> - surface.<br>
> + This creates an xdg_surface for the given surface and gives it the<br>
> + xdg_surface role. See the documentation of xdg_surface for more details.<br>
> </description><br>
> <arg name="id" type="new_id" interface="xdg_surface"/><br>
> <arg name="surface" type="object" interface="wl_surface"/><br>
> </request><br>
><br>
> <request name="get_xdg_popup"><br>
> - <description summary="create a shell surface from a surface"><br>
> - Create a popup surface for an existing surface.<br>
> -<br>
> - This request gives the surface the role of xdg_popup. If the<br>
> - surface already has another role, it raises a protocol error.<br>
> + <description summary="create a popup for a surface"><br>
> + This creates an xdg_popup for the given surface and gives it the<br>
> + xdg_popup role. See the documentation of xdg_surface for more details.<br>
><br>
> - Only one shell or popup surface can be associated with a given<br>
> - surface.<br>
> + This request must be used in response to some sort of user action<br>
> + like a button press, key press, or touch down event.<br>
> </description><br>
> <arg name="id" type="new_id" interface="xdg_popup"/><br>
> <arg name="surface" type="object" interface="wl_surface"/><br>
> <arg name="parent" type="object" interface="wl_surface"/><br>
> - <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat whose pointer is used"/><br>
> - <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/><br>
> + <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/><br>
> + <arg name="serial" type="uint" summary="the serial of the user event"/><br>
> <arg name="x" type="int"/><br>
> <arg name="y" type="int"/><br>
> </request><br>
> @@ -107,7 +104,7 @@<br>
> respond to the ping request, or in what timeframe. Clients should<br>
> try to respond in a reasonable amount of time.<br>
> </description><br>
> - <arg name="serial" type="uint" summary="pass this to the callback"/><br>
> + <arg name="serial" type="uint" summary="pass this to the pong request"/><br>
> </event><br>
><br>
> <request name="pong"><br>
> @@ -120,8 +117,7 @@<br>
> </interface><br>
><br>
> <interface name="xdg_surface" version="1"><br>
> -<br>
> - <description summary="desktop-style metadata interface"><br>
> + <description summary="A desktop window"><br>
> An interface that may be implemented by a wl_surface, for<br>
> implementations that provide a desktop-style user interface.<br>
><br>
> @@ -136,20 +132,22 @@<br>
> </description><br>
><br>
> <request name="destroy" type="destructor"><br>
> - <description summary="remove xdg_surface interface"><br>
> - The xdg_surface interface is removed from the wl_surface object<br>
> - that was turned into a xdg_surface with<br>
> - xdg_shell.get_xdg_surface request. The xdg_surface properties,<br>
> - like maximized and fullscreen, are lost. The wl_surface loses<br>
> - its role as a xdg_surface. The wl_surface is unmapped.<br>
> + <description summary="Destroy the xdg_surface"><br>
> + Unmap and destroy the window. The window will be effectively<br>
> + hidden from the user's point of view, and all state like<br>
> + maximization, fullscreen, and so on, will be lost.<br>
> </description><br>
> </request><br>
><br>
> <request name="set_parent"><br>
> - <description summary="surface is a child of another surface"><br>
> - Child surfaces are stacked above their parents, and will be<br>
> - unmapped if the parent is unmapped too. They should not appear<br>
> - on task bars and alt+tab.<br>
> + <description summary="set the parent of this surface"><br>
> + Set the "parent" of this surface. This window should be stacked<br>
> + above a parent. The parent surface must be mapped as long as this<br>
> + surface is mapped.<br>
> +<br>
> + Parent windows should be set on dialogs, toolboxes, or other<br>
> + "auxilliary" surfaces, so that the parent is raised when the dialog<br>
> + is raised.<br>
> </description><br>
> <arg name="parent" type="object" interface="xdg_surface" allow-null="true"/><br>
> </request><br>
> @@ -168,14 +166,19 @@<br>
> </request><br>
><br>
> <request name="set_app_id"><br>
> - <description summary="set surface class"><br>
> - Set an id for the surface.<br>
> + <description summary="set application ID"><br>
> + Set an application identifier for the surface.<br>
> +<br>
> + The app ID identifies the general class of applications to which<br>
> + the surface belongs. The compositor can use this to group multiple<br>
> + applications together, or to determine how to launch a new<br>
> + application.<br>
<br>
<br>
</div></div>Given this is an application specific property why is it in<br>
xdg_surface instead of being in xdg_shell?<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> - The app id identifies the general class of applications to which<br>
> - the surface belongs.<br>
> + See the desktop-entry specification [0] for more details on<br>
> + application identifiers and how they relate to well-known DBus<br>
> + names and .desktop files.<br>
><br>
> - It should be the ID that appears in the new desktop entry<br>
> - specification, the interface name.<br>
> + [0] <a href="http://standards.freedesktop.org/desktop-entry-spec/" target="_blank">http://standards.freedesktop.org/desktop-entry-spec/</a><br>
> </description><br>
> <arg name="app_id" type="string"/><br>
> </request><br>
> @@ -187,29 +190,32 @@<br>
> user a menu that they can use to maximize or minimize the window.<br>
><br>
> This request asks the compositor to pop up such a window menu at<br>
> - the given position, relative to the parent surface. There are<br>
> - no guarantees as to what the window menu contains.<br>
> + the given position, relative to the local surface coordinates of<br>
> + the parent surface. There are no guarantees as to what menu items<br>
> + the window menu contains.<br>
><br>
> - Your surface must have focus on the seat passed in to pop up the<br>
> - window menu.<br>
> + This request must be used in response to some sort of user action<br>
> + like a button press, key press, or touch down event.<br>
> </description><br>
><br>
> - <arg name="seat" type="object" interface="wl_seat" summary="the seat to pop the window up on"/><br>
> - <arg name="serial" type="uint" summary="serial of the event to pop up the window for"/><br>
> + <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/><br>
> + <arg name="serial" type="uint" summary="the serial of the user event"/><br>
> <arg name="x" type="int" summary="the x position to pop up the window menu at"/><br>
> <arg name="y" type="int" summary="the y position to pop up the window menu at"/><br>
> </request><br>
><br>
> <request name="move"><br>
> <description summary="start an interactive move"><br>
> - Start a pointer-driven move of the surface.<br>
> + Start an interactive, user-driven move of the surface.<br>
> +<br>
> + This request must be used in response to some sort of user action<br>
> + like a button press, key press, or touch down event.<br>
><br>
> - This request must be used in response to a button press event.<br>
> The server may ignore move requests depending on the state of<br>
> the surface (e.g. fullscreen or maximized).<br>
> </description><br>
> - <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat whose pointer is used"/><br>
> - <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/><br>
> + <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/><br>
> + <arg name="serial" type="uint" summary="the serial of the user event"/><br>
> </request><br>
><br>
> <enum name="resize_edge"><br>
> @@ -232,14 +238,16 @@<br>
><br>
> <request name="resize"><br>
> <description summary="start an interactive resize"><br>
> - Start a pointer-driven resizing of the surface.<br>
> + Start a user-driven, interactive resize of the surface.<br>
> +<br>
> + This request must be used in response to some sort of user action<br>
> + like a button press, key press, or touch down event.<br>
><br>
> - This request must be used in response to a button press event.<br>
> The server may ignore resize requests depending on the state of<br>
> the surface (e.g. fullscreen or maximized).<br>
> </description><br>
> - <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat whose pointer is used"/><br>
> - <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/><br>
> + <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/><br>
> + <arg name="serial" type="uint" summary="the serial of the user event"/><br>
> <arg name="edges" type="uint" summary="which edge or corner is being dragged"/><br>
> </request><br>
><br>
> @@ -287,16 +295,21 @@<br>
><br>
> <event name="configure"><br>
> <description summary="suggest a surface change"><br>
> - The configure event asks the client to resize its surface.<br>
> + The configure event asks the client to resize its surface or to<br>
> + change its state.<br>
><br>
> The width and height arguments specify a hint to the window<br>
> - about how its surface should be resized in window geometry<br>
> - coordinates. The states listed in the event specify how the<br>
> - width/height arguments should be interpreted.<br>
> + about how its surface should be resized in window geometry<br>
> + coordinates.<br>
> +<br>
> + The states listed in the event specify how the width/height<br>
> + arguments should be interpreted, and possibly how it should be<br>
> + drawn.<br>
><br>
> - A client should arrange a new surface, and then send a<br>
> - ack_configure request with the serial sent in this configure<br>
> - event before attaching a new surface.<br>
> + Clients should arrange their surface for the new size and<br>
> + states, and then send a ack_configure request with the serial<br>
> + sent in this configure event at some point before committing<br>
> + the new surface.<br>
><br>
> If the client receives multiple configure events before it<br>
> can respond to one, it is free to discard all but the last<br>
> @@ -311,14 +324,20 @@<br>
><br>
> <request name="ack_configure"><br>
> <description summary="ack a configure event"><br>
> - When a configure event is received, a client should then ack it<br>
> - using the ack_configure request to ensure that the compositor<br>
> - knows the client has seen the event.<br>
> -<br>
> - By this point, the state is confirmed, and the next attach should<br>
> - contain the buffer drawn for the configure event you are acking.<br>
> + When a configure event is received, if a client is updating<br>
> + and redrawing its state in response to the configure event,<br>
> + then the client needs to make an ack_configure request before<br>
> + point the commit to mark this next commit as being a<br>
> + reaction to the configure.<br>
> +<br>
> + The compositor might use this information to move a surface<br>
> + to the top left only when the client has drawn itself for<br>
> + the maximized or fullscreen state.<br>
> +<br>
> + If the client receives multiple configure events before it<br>
> + can respond to one, it only has to ack the last configure event.<br>
> </description><br>
> - <arg name="serial" type="uint" summary="a serial to configure for"/><br>
> + <arg name="serial" type="uint" summary="the serial from the configure event"/><br>
> </request><br>
><br>
> <request name="set_window_geometry"><br>
> @@ -328,15 +347,20 @@<br>
> portions like drop-shadows which should be ignored for the<br>
> purposes of aligning, placing and constraining windows.<br>
><br>
> - The default value is the full bounds of the surface, including any<br>
> - subsurfaces. Once the window geometry of the surface is set once,<br>
> - it is not possible to unset it, and it will remain the same until<br>
> + Once the window geometry of the surface is set once, it is not<br>
> + possible to unset it, and it will remain the same until<br>
> set_window_geometry is called again, even if a new subsurface or<br>
> buffer is attached.<br>
><br>
> + If never set, the value is the full bounds of the surface,<br>
> + including any subsurfaces. This updates dynamically on every<br>
> + commit. This unset mode is meant for extremely simple clients.<br>
> +<br>
> If responding to a configure event, the window geometry in here<br>
> must respect the sizing negotiations specified by the states in<br>
> the configure event.<br>
> +<br>
> + The width and height must be greater than zero.<br>
> </description><br>
> <arg name="x" type="int"/><br>
> <arg name="y" type="int"/><br>
> @@ -359,7 +383,18 @@<br>
> </request><br>
> <request name="unset_fullscreen" /><br>
><br>
> - <request name="set_minimized" /><br>
> + <request name="set_minimized"><br>
> + <description summary="set the window as minimized"><br>
> + Request that the compositor minimize your surface. There is no<br>
> + way to know if the surface is currently minimized, nor is there<br>
> + any way to unset minimization on this surface.<br>
> +<br>
> + If you are looking to throttle redrawing when minimized, please<br>
> + instead use the wl_surface.frame event for this, as this will<br>
> + also work with live previews on windows in Alt-Tab, Expose or<br>
> + similar compositor features.<br>
> + </description><br>
> + </request><br>
><br>
> <event name="close"><br>
> <description summary="surface wants to be closed"><br>
> @@ -376,26 +411,48 @@<br>
> </interface><br>
><br>
> <interface name="xdg_popup" version="1"><br>
> - <description summary="desktop-style metadata interface"><br>
> - An interface that may be implemented by a wl_surface, for<br>
> - implementations that provide a desktop-style popups/menus. A popup<br>
> - surface is a transient surface with an added pointer grab.<br>
> -<br>
> - An existing implicit grab will be changed to owner-events mode,<br>
> - and the popup grab will continue after the implicit grab ends<br>
> - (i.e. releasing the mouse button does not cause the popup to be<br>
> - unmapped).<br>
> -<br>
> - The popup grab continues until the window is destroyed or a mouse<br>
> - button is pressed in any other clients window. A click in any of<br>
> - the clients surfaces is reported as normal, however, clicks in<br>
> - other clients surfaces will be discarded and trigger the callback.<br>
> -<br>
> - The x and y arguments specify the locations of the upper left<br>
> - corner of the surface relative to the upper left corner of the<br>
> - parent surface, in surface local coordinates.<br>
> -<br>
> - xdg_popup surfaces are always transient for another surface.<br>
> + <description summary="short-lived, popup surfaces for menus"><br>
> + A popup surface is a short-lived, temporary surface that can be<br>
> + used to implement menus. It takes an explicit grab on the surface<br>
> + that will be dismissed when the user dismisses the popup. This can<br>
> + be done by the user clicking outside the surface, using the keyboard,<br>
> + or even locking the screen through closing the lid or a timeout.<br>
> +<br>
> + When the popup is dismissed, a popup_done event will be sent out,<br>
> + and at the same time the surface will be unmapped. The xdg_popup<br>
> + object is now inert and cannot be reactivated, so clients should<br>
> + destroy it. Explicitly destroying the xdg_popup object will also<br>
> + dismiss the popup, and unmap the surface.<br>
> +<br>
> + Clients will receive events for all their surfaces during this<br>
> + grab (which is an "owner-events" grab in X11 parlance). This is<br>
> + done so that users can navigate through submenus and other<br>
> + "nested" popup windows without having to dismiss the topmost<br>
> + popup.<br>
> +<br>
> + Clients that want to dismiss the popup when another surface of<br>
> + their own is clicked should dismiss the popup using the destroy<br>
> + request.<br>
> +<br>
> + The parent surface must have either an xdg_surface or xdg_popup<br>
> + role.<br>
> +<br>
> + Specifying an xdg_popup for the parent means that the popups are<br>
> + nested, with this popup now being the topmost popup. Nested<br>
> + popups must be destroyed in the reverse order they were created<br>
> + in, e.g. the only popup you are allowed to destroy at all times<br>
> + is the topmost one.<br>
> +<br>
> + If there is an existing popup when creating a new popup, the<br>
> + parent must be the current topmost popup.<br>
> +<br>
> + When compositors choose to dismiss a popup if the user clicks<br>
> + outside the window, they will likely dismiss every nested popup<br>
> + as well.<br>
> +<br>
> + The x and y arguments specify where the top left of the popup<br>
> + should be placed, relative to the local surface coordinates of the<br>
> + parent surface.<br>
> </description><br>
><br>
> <enum name="error"><br>
> @@ -407,19 +464,18 @@<br>
><br>
> <request name="destroy" type="destructor"><br>
> <description summary="remove xdg_surface interface"><br>
> - The xdg_surface interface is removed from the wl_surface object<br>
> - that was turned into a xdg_surface with<br>
> - xdg_shell.get_xdg_surface request. The xdg_surface properties,<br>
> - like maximized and fullscreen, are lost. The wl_surface loses<br>
> - its role as a xdg_surface. The wl_surface is unmapped.<br>
> + This destroys the popup. Explicitly destroying the xdg_popup<br>
> + object will also dismiss the popup, and unmap the surface.<br>
> +<br>
> + If this xdg_popup is not the "topmost" popup, a protocol error<br>
> + will be sent.<br>
> </description><br>
> </request><br>
><br>
> <event name="popup_done"><br>
> <description summary="popup interaction is done"><br>
> - The popup_done event is sent out when a popup grab is broken,<br>
> - that is, when the users clicks a surface that doesn't belong<br>
> - to the client owning the popup surface.<br>
> + The popup_done event is sent out when a popup is dismissed<br>
> + by the compositor.<br>
> </description><br>
> </event><br>
><br>
> --<br>
> 2.1.0<br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> wayland-devel mailing list<br>
> <a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</div></div></blockquote></div><br clear="all"><br>-- <br><div class="gmail_signature"> Jasper<br></div>
</div>