<div dir="ltr"><div><div>Nice work Alexandros!<br><br></div>This solution captures the requirements that I know of.<br><br></div>--Robert<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 28, 2013 at 4:10 AM, Alexandros Frantzis <span dir="ltr"><<a href="mailto:alexandros.frantzis@canonical.com" target="_blank">alexandros.frantzis@canonical.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
there are two related but slightly different aspects of multi-monitor<br>
handling.  The first is reacting to HW configuration changes (e.g. user<br>
plugs in/out a monitor). The second is reacting to configuration change<br>
requests from clients.  It's a complex situation, and I am trying to<br>
find some model that will elegantly and simply accommodate both of these<br>
aspects. Here are my thoughts so far...<br>
<br>
The display server works with a virtual coordinate space, which is used<br>
for both display and input. Outputs are placed in rectangles in this<br>
coordinate space. A display configuration is a particular placement of<br>
the outputs in the coordinate space (of course, not placing an output is<br>
a valid placement) with valid sizes for each output (corresponding to a<br>
supported mode).<br>
<br>
The display server will have a base display configuration. Each session<br>
(aka application, Mir connection) will optionally have a custom display<br>
configuration associated with it. Having such a configuration means that<br>
the session has special modesetting needs, and that this configuration<br>
will be applied when the session is focused (whatever this means in each<br>
case), and reverted (i.e. the base configuration will be reapplied) when<br>
we focus a normal session.<br>
<br>
Here is how this would work in some interesting scenarios:<br>
<br>
Scenario 1: Two XMir sessions<br>
-----------------------------<br>
<br>
We are in the greeter, with the base configuration applied.<br>
<br>
XMir session 1 starts up, gets the base display configuration, sends<br>
back a changed configuration and creates/changes its surfaces to match<br>
the configuration. Mir applies the new config since XMir 1 has the<br>
focus.<br>
<br>
We switch away from XMir 1 to the greeter, therefore reverting to the<br>
base configuration.<br>
<br>
XMir session 2 starts up, gets the base display configuration, sends<br>
back a changed configuration and changes its surfaces to match the<br>
configuration. Mir applies the new config since XMir 2 has the focus.<br>
<br>
Now, as we switch between XMir 1 and XMir 2 their respective custom<br>
configurations are applied.<br>
<br>
Scenario 2: Two XMir sessions, new monitor plugged/removed<br>
----------------------------------------------------------<br>
<br>
XMir 1 is active, a new monitor is plugged. Mir detects the change and<br>
changes its base configuration (without applying it, since a session<br>
with a custom config has the focus). It then notifies all sessions (or<br>
perhaps only those who already have a special config).<br>
<br>
XMir 1 gets the new (base) configuration, decides what it needs, sends a<br>
new config back and changes its surfaces to match. Since XMir 1 is the<br>
focused session, Mir applies the new configuration.<br>
<br>
XMir 2 gets the new (base) configuration, decides what it needs, sends<br>
new config back, changes its surfaces to match. The XMir 2 configuration<br>
is not applied since XMir 2 is not focused.<br>
<br>
Scenario 3: XMir requests new config (e.g. an XRandR request)<br>
-------------------------------------------------------------<br>
<br>
XMir sends a new config to Mir, and changes its surfaces to match. Mir<br>
gets and applies the new configuration (since presumably XMir is<br>
focused).<br>
<br>
Scenario 4: Mir session/app messes up its custom display configuration<br>
----------------------------------------------------------------------<br>
<br>
No problem. When the session/app loses focus (or gets killed) the base<br>
configuration will be applied.<br>
<br>
Scenario 5: Native Mir app wants to become fullscreen in one of the<br>
connected screens<br>
-------------------------------------------------------------------<br>
<br>
The app gets the base display configuration, creates or changes its<br>
surfaces to become fullscreen.<br>
<br>
Scenario 6: Native Mir app wants to become fullscreen in one of the<br>
connected screens *and* wants to have a different resolution there.<br>
-------------------------------------------------------------------<br>
<br>
The app gets the base display configuration, changes what it needs (e.g.<br>
changes modes and position in virtual space in one of the connected<br>
screens) and changes surfaces to match. This is the same as the XMir<br>
cases discussed above. Will we allow all apps to change the modes?<br>
<br>
Note that for these scenarios to work, we need to allow clients to make<br>
a surface fullscreen for a specific output (they can get output ids from<br>
the configuration).<br>
<br>
Thanks,<br>
Alexandros<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Mir-devel mailing list<br>
<a href="mailto:Mir-devel@lists.ubuntu.com">Mir-devel@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/mir-devel" target="_blank">https://lists.ubuntu.com/mailman/listinfo/mir-devel</a><br>
</font></span></blockquote></div><br></div>