<p dir="ltr"><br>
On May 15, 2013 9:37 PM, "Mikko Levonmaa" <<a href="mailto:mikko.levonmaa@gmail.com">mikko.levonmaa@gmail.com</a>> wrote:<br>
><br>
> > I agree that the thread is a little daunting and gets<br>
> > political/personal towards the end. But between Pekka, Jason and Bill<br>
> > I see concensus and I'll try to summarize here:<br>
> ><br>
> > - The server needs to be able to initiate state changes, but the<br>
> > client is in control. The server requests a state change but the<br>
> > client ultimately has to set the new state and provide a new<br>
> > buffer. In case of maximize and unmaximize, the client has to<br>
> > provide a new buffer before the state can change and in case of<br>
> > minimize, the client may want to hide other windows as well as it<br>
> > minimizes.<br>
> ><br>
> > - Discussion about whether states are orthogonal flags that the<br>
> > client sets or if the client just sets the current state. The<br>
> > distinction is whether the compositor knows the full set of states<br>
> > or only the effective state. For example, if you maximize a window<br>
> > and then minimize it, does the compositor know that it's maximized<br>
> > and minimized or only that it's currently minimized? I think the<br>
> > compositor needs to know all the state, so that it's possible to<br>
> > implement something like unmaximize while minimized.<br>
> ><br>
> > There's a catch: the current model (set_toplevel, set_fullscreen<br>
> > and set_maximized) doesn't work this way, these requests always set<br>
> > the current state, not a flag. I think we can fit those into the<br>
> > new mechanism: set_toplevel clears all states, set_maximized sets<br>
> > maximized and clears fullscreen, and set_fullscreen sets fullscreen.<br>
> ><br>
> > - Enum vs set_minimized. Do we add an enum with states and a<br>
> > set(state) request or do we add set_minimized etc? We only lack<br>
> > set_minimized currently, but we also need events to let the<br>
> > compositor initiate state changes, so we would have to add<br>
> > request_maximized/minimized events as well as<br>
> > request_unmaximized/unminimized. If we add an enum of states<br>
> > instead, we can add set and clear requests and request_set and<br>
> > request_clear events.<br>
> ><br>
> > Using an enum also lets us add sticky and always-on-top as enum<br>
> > values.<br>
> ><br>
> > - Visibility and frame events during minimized is orthogonal and up<br>
> > to the compositor. The compositor can keep sending frame events at<br>
> > the full frame rate or throttle the application down to a few<br>
> > frames per second for example. But the compositor can do that at<br>
> > any time, for example if the window is fully obscured by an opaque<br>
> > surface, there's really no interaction with being minimized.<br>
> ><br>
> > - Stacking is an orthogonal issue. Currently clients can't assume<br>
> > anything about their stacking order relative to other clients, so a<br>
> > compositor is free to unminimize surfaces to anywhere in the stack.<br>
> ><br>
> > - We've also talked about a request_close event that the compositor<br>
> > can use to ask a client to close its window. This useful for<br>
> > closing from a window list or from something like the GNOME Shell<br>
> > overview. I think this is straight forward, though not directly<br>
> > related to the state stuff here.<br>
> ><br>
> > If we turn this into protocol, I think it will look something like this:<br>
><br>
><br>
> > <interface name="wl_shell_surface" version="1"><br>
> ><br>
> > ...<br>
> ><br>
> > <enum name="state"><br>
> > <description summary="surface states"><br>
> > This is a bitmask of capabilities this seat has; if a member is<br>
> > set, then it is present on the seat.<br>
> > </description><br>
> > <entry name="maximized" value="1"/><br>
> > <entry name="minimized" value="2"/><br>
> > <entry name="sticky" value="3"/><br>
> > <entry name="always_on_top" value="4"/><br>
> > </enum><br>
><br>
> Arent we missing the fullscreen from the above enum? Also the rationale<br>
> for me adding the default state (in the other thread) was that it would<br>
> indicate to the compositor that it is the "normal" state of the the app<br>
> i.e. when going from maximized/fullscreen to the default state the<br>
> compositor could remember the last size and propose that to the client.</p>
<p dir="ltr">Fullscreen is a bit special as it requires other arguments (mode and output). You cant merely set it as a flag. It should probably be considered as a different mode all together. More specifically, the flags only apply to toplevel surfaces. (Maximized will require a little work to keep backwards compatibility.)</p>
<p dir="ltr">><br>
> > <request name="set" since="2"><br>
> > <description summary="Set the specified surface state"/><br>
> > <arg name="state" type="uint"/><br>
> > </request><br>
><br>
> To me the word 'set' implies that this will happen and in some cases the<br>
> compositor might not honor this, so in a way it is a request. Perhaps<br>
> 'request_state'?</p>
<p dir="ltr">The client is setting surface flags (perhaps "unset" would be better than "clear" below). Exactly what the compositor does will depend on a precedence order. Kristian didn't define it above but it shouldn't be too hard to do. That said, the order should be well documented.</p>
<p dir="ltr">Why wouldn't the server respect the flags? Also, when this request is handled, the flag is set. The only strange thing the compositor can do is to do something unexpected with the flags.</p>
<p dir="ltr">><br>
> ><br>
> > <request name="clear" since="2"><br>
> > <description summary="Clear the specified surface state"/><br>
> > <arg name="state" type="uint"/><br>
> > </request><br>
><br>
> This is a bit unclear to me. Does the compositor take some action after<br>
> this request or is the state just cleared on the compositors side? It<br>
> seems a bit open ended... if the client has set the state to say fullscreen<br>
> and then clears it will the surface still stay fullscreen.</p>
<p dir="ltr">The compositor will change how it handles the surface to the set flag with highest priority. Suppose minimize is higher priority than maximize and both are set. If the client unsets maximize then nothing will happen because minimize is still set and it has the higher priority.</p>
<p dir="ltr">It is worth noting here that some flags may not really play into the priority order. For instance, an on-every-workspace flag (is that what is meant by "sticky"?) wouldn't really have anything to do with maximize or minimize at all. Some flags may just be hints to the compositor or window. Another example of this would be a "tiled" flag for tiling WM's.</p>
<p dir="ltr">> > ...<br>
> ><br>
> > <event name="request_set" since="2"><br>
> > <description summary="request to set the specified surface state"/><br>
> > <arg name="state" type="uint"/><br>
> > </event><br>
> ><br>
> > <event name="request_clear" since="2"><br>
> > <description summary="request to clear the specified surface state"/><br>
> > <arg name="state" type="uint"/><br>
> > </event><br>
> ><br>
> > <event name="request_close" since="2"/><br>
> ><br>
> > </interface><br>
> ><br>
> > How does that look?<br>
><br>
> Excellent ;)<br>
><br>
> ><br>
> > Kristian<br>
> ><br>
> ><br>
> > ------------------------------<br>
> ><br>
> > _______________________________________________<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">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
> ><br>
> ><br>
> > End of wayland-devel Digest, Vol 32, Issue 73<br>
> > *********************************************<br>
> _______________________________________________<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">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a></p>
<p dir="ltr">Hope that helps,<br>
--Jason Ekstrand<br>
</p>