Position set/get prototype template
Igor Korot
ikorot01 at gmail.com
Mon Aug 8 14:41:10 UTC 2022
Hi,
On Mon, Aug 8, 2022, 9:27 AM samuel ammonius <sfammonius at gmail.com> wrote:
> Hi,
>
> I started a discussion a while ago about the possibility of adding
> position set/get abilities to wayland, but since then I'd learned alot
> about how wayland works. I had heard that wayland combines the WM and
> server into one "compositor", but I thought wayland itself still managed
> some things. Since then I've learned that the compositor manages every
> event that a wayland client sends, and I think this makes the ability to
> set/get a position even more necessary.
>
On top of that, the end user (a human sitting behind the monitor) can
reconfigure everything, because "we all know better and computers are dumb".
The reasons are:
>
> 1. Apps can send both the position they want for a window and and the
> type of window, and a compositor can choose which one to follow. (for
> example, a client can send (width/2, height/2) and "popup" for a popup
> surface, and compositors that prefer to follow the descriptive design will
> follow "popup" and ones that prefer prescriptive design will follow the
> coordinates).
> 2. Waylands asynchronous event system means that a compositor can ask
> users if they would like to give an app permission to move itself and/or
> other windows, similar to how android asks before giving apps camera/GPS
> permissions.
>
> I've looked at existing wayland protocols and used them to create a simple
> one for position set/get.
>
> ------------------------------------------------------------------------------------------
>
>
> <?xml version="1.0" encoding="UTF-8"?><protocol name="pos_unstable_v1"> <copyright> Copyright © 2022 Samuel Ammonius Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. </copyright>
>
> <interface name="zwp_pos_v1" version="1"> <description summary="position management protocol"> Used to set/get the position of a surface. The ability to set the monitor that a surface is on is not available yet.
>
>
> Warning! The protocol described in this file is experimental and backward incompatible changes may be made. Backward compatible changes may be added together with the corresponding interface version bump. Backward incompatible changes are done by bumping the version number in the protocol and interface names and resetting the interface version. Once the protocol is to be declared stable, the 'z' prefix and the version number in the protocol and interface names are removed and the interface version number is reset. </description>
>
> <request name="set_pos"> <description summary="position setter"> Set the position of a surface </description>
>
> <arg name="surface" type="object" interface="wl_surface" summary="target surface"/>
>
> <arg name="x" type="int"/>
>
> <arg name="y" type="int"/>
>
> </request> <event name="pos_changed"> <description summary="position
> changed event"> Notification that a surface has been moved, either by
> itself, another program, or the compositor.
>
> WARNING: Do not use this event to force a surface to a certain position. If multiple apps want the surface in a different position, then the computer may freeze or glitch.
>
> </description>
>
> <arg name="x" type="int"/>
>
> <arg name="y" type="int"/>
>
> </event>
>
> <event name="get_pos">
>
> <arg name="x" type="int"/>
>
> <arg name="y" type="int"/>
>
> </event>
>
> </interface>
>
> </protocol>
>
> ------------------------------------------------------------------------------------------
>
> Should I just send it or is my reasoning (or XML syntax) wrong?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20220808/2b848333/attachment-0001.htm>
More information about the wayland-devel
mailing list