<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[MirOil-for-Lomiri]]></title><description><![CDATA[<h1>MirOil-for-Lomiri</h1>
<p dir="auto">I've set up a temporary Github project to maintain the work in progress on Miroil. It is here:</p>
<p dir="auto"><a href="https://github.com/MirOil-for-Lomiri" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/MirOil-for-Lomiri</a></p>
<p dir="auto">This contains forks of two projects: Mir and QtMir. These can be kept in step with the growing Miroil API.</p>
<p dir="auto">So that these can be used together, the default branch (<code>mir-1.9-miroil</code>) of Mir is based upon Mir 1.8, and the default branch (<code>miroil</code>) of QtMir is based on <code>https://github.com/ubports/qtmir/tree/xenial_-_edge_-_wayland_-_x11</code>.</p>
<p dir="auto">This is work I started last year and have been continued by "erlend-g" this year.</p>
<h2>The problem and the approach</h2>
<p dir="auto">Currently QtMir can only build against Mir 1.x as it depends on some APIs that were removed in Mir 2.x. Miroil is intended to replace the missing functionality by moving some logic from QtMir to Miroil.</p>
<p dir="auto">By publishing the functionality as new, cleaner APIs in Miroil this will make it possible to use QtMir on Mir 2.x. This is important for UBports as QtMir is the library that Lomiri uses to work on Mir.</p>
<p dir="auto">By basing this work in progress on Mir 1.x, it is possible to make incremental changes to both Miroil and QtMir while everything keeps running. In particular, it is possible to run the QtMir demo and tests (but see below) following changes to these projects.</p>
<h2>Getting and building the source</h2>
<p dir="auto">QtMir has a bunch of dependencies that are not in the Ubuntu archive, so the best approach I've found is to take an Ubuntu 16.04 system (installed on an old laptop) and add the UBports archive. (It is also possible to a VM, but this stack needs 3D acceleration enabled, and there may be other quirks.)</p>
<p dir="auto">So, on a 16.04 system:</p>
<pre><code>sudo apt-add-repository http://repo.ubports.com/
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4BD4B4D6DBB583F1
sudo apt update
sudo apt dist-upgrade
</code></pre>
<h3>Mir</h3>
<p dir="auto">Next, add some development tools and clone and build Mir:</p>
<pre><code>sudo apt install devscripts equivs git
git clone --recursive https://github.com/MirOil-for-Lomiri/mir.git
cd mir
sed -i /.*wlcs.*/d debian/control
mk-build-deps -i -s sudo
mkdir build
cd  build
cmake -DMIR_ENABLE_WLCS_TESTS=off ..
make -4
</code></pre>
<p dir="auto">Then install in /usr/local:</p>
<pre><code>sudo make install
sudo ldconfig
</code></pre>
<h3>QtMir</h3>
<p dir="auto">Clone QtMir, get the remaining dependencies and build:</p>
<pre><code>git clone https://github.com/MirOil-for-Lomiri/qtmir.git
cd qtmir
mk-build-deps -i -s sudo
mkdir -p cmake-build-debug
cd cmake-build-debug
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..
make -j 4 all test
</code></pre>
<p dir="auto">Note that one of the tests crashes: <code>Test  #9: ApplicationManager ...............***Exception: SegFault  0.28 sec</code>. That happens on the upstream branch too and I've not investigated further.</p>
<p dir="auto">Then install in /usr/local:</p>
<pre><code>sudo make install
sudo ldconfig
sudo ln -s /usr/local/share/glib-2.0/schemas/com.canonical.qtmir.gschema.xml /usr/share/glib-2.0/schemas/
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/
</code></pre>
<h2>Running the demo</h2>
<p dir="auto">The demos are in the <code>demos</code> directory.</p>
<pre><code>export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/local/lib/qt5/plugins/platforms
export QML2_IMPORT_PATH=/usr/local/lib/qt5/qml
export QT_QPA_PLATFORM=mirserver
export MIR_SERVER_ENABLE_MIRCLIENT=
export MIR_SERVER_CURSOR=null
qmlscene demos/qml-demo-shell/qml-demo-shell.qml
</code></pre>
<h2>Next steps</h2>
<p dir="auto">I'm in the process of syncing the Mir branch with the changes upstream, and have re-sync'ed the QtMir branch. I've invited <a class="plugin-mentions-user plugin-mentions-a" href="/user/mariogrip" aria-label="Profile: mariogrip">@<bdi>mariogrip</bdi></a> and "erlend-g" to join the project, and anyone else interested in helping should contact me.</p>
]]></description><link>https://forums.ubports.com/topic/5822/miroil-for-lomiri</link><generator>RSS for Node</generator><lastBuildDate>Sat, 16 May 2026 23:23:40 GMT</lastBuildDate><atom:link href="https://forums.ubports.com/topic/5822.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 05 Mar 2021 17:29:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MirOil-for-Lomiri on Sat, 05 Jun 2021 11:33:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/erlend" aria-label="Profile: erlend">@<bdi>erlend</bdi></a> I've had a first look, and three of those test doubles are unused in the current codebase. There's a PR dropping them for your review.</p>
<p dir="auto">The others are used in a range of tests I've yet to work through.</p>
]]></description><link>https://forums.ubports.com/post/51615</link><guid isPermaLink="true">https://forums.ubports.com/post/51615</guid><dc:creator><![CDATA[alan_g]]></dc:creator><pubDate>Sat, 05 Jun 2021 11:33:40 GMT</pubDate></item><item><title><![CDATA[Reply to MirOil-for-Lomiri on Sat, 05 Jun 2021 08:30:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan_g" aria-label="Profile: alan_g">@<bdi>alan_g</bdi></a> Okey good, I'll start by upstream what is left, and then return to the test after that.</p>
]]></description><link>https://forums.ubports.com/post/51612</link><guid isPermaLink="true">https://forums.ubports.com/post/51612</guid><dc:creator><![CDATA[erlend]]></dc:creator><pubDate>Sat, 05 Jun 2021 08:30:19 GMT</pubDate></item><item><title><![CDATA[Reply to MirOil-for-Lomiri on Thu, 03 Jun 2021 15:49:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/erlend" aria-label="Profile: erlend">@<bdi>erlend</bdi></a> thanks for bringing this up.</p>
<p dir="auto">I don't have the headspace right now to look at the problematic tests. But, for background, Mir used to publish a test helpers library containing various stubs, mocked objects and test fixtures. That got unpublished along with the mirclient stuff that it depended heavily on. (It is on my "tech debt" list to reinstate something appropriate to the current APIs.)</p>
<p dir="auto">I think a separate "testing support" library is a better place to support mocks than libmiroil.</p>
<p dir="auto">Another possibility would be that at least some of these tests belong as tests of miroil (i.e. in the Mir project).</p>
<p dir="auto">I will have a closer look, but not sure when I'll have time.</p>
]]></description><link>https://forums.ubports.com/post/51540</link><guid isPermaLink="true">https://forums.ubports.com/post/51540</guid><dc:creator><![CDATA[alan_g]]></dc:creator><pubDate>Thu, 03 Jun 2021 15:49:02 GMT</pubDate></item><item><title><![CDATA[Reply to MirOil-for-Lomiri on Thu, 03 Jun 2021 11:07:35 GMT]]></title><description><![CDATA[<p dir="auto">I'm trying to find a good way to solve qtmir tests. For the test to work they need a lot of mocks that are based on internal mir stuff. And since they are used directly into mir it is not possible to build wrappers.</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Include file</th>
<th>Object</th>
<th>test file</th>
<th>Defined in</th>
</tr>
</thead>
<tbody>
<tr>
<td>mir/main_loop.h</td>
<td>mir::MainLoop</td>
<td>tests/framework/mock_main_loop.h</td>
<td>src/include/server/mir/main_loop.h</td>
</tr>
<tr>
<td>mir/scene/prompt_session.h</td>
<td>mir::scene::PromptSession</td>
<td>tests/framework/mock_prompt_session.h</td>
<td>src/include/server/mir/scene/prompt_session.h</td>
</tr>
<tr>
<td>mir/scene/surface.h&gt;</td>
<td>mir::scene::Surface</td>
<td>tests/framework/mock_surface.h</td>
<td>src/include/server/mir/scene/surface.h</td>
</tr>
<tr>
<td>mir/shell/persistent_surface_store.h</td>
<td><code>mir::shell::PersistentSurfaceStore</code></td>
<td>tests/framework/mock_persistent_surface_store.h</td>
<td>src/include/server/mir/shell/persistent_surface_store.h</td>
</tr>
<tr>
<td>mir/scene/session.h</td>
<td>mir::scene::Session</td>
<td>tests/framework/mock_mir_session.h</td>
<td>src/include/server/mir/scene/session.h</td>
</tr>
</tbody>
</table>
<p dir="auto">So the best solution (or least bad) that I have come up with is...<br />
to move all those mocks to miroil and make them accessible through a MockFactory... Something like:</p>
<pre><code>class MockFactory
{
    auto get_mock_surface()                  -&gt; std::shared_ptr&lt;mir::scene::Surface&gt;;
    auto get_mock_main_loop()                -&gt; std::shared_ptr&lt;mir::MainLoop&gt;;
    auto get_mock_prompt_session()           -&gt; std::shared_ptr&lt;mir::scene::PromptSession&gt;;
    auto get_mock_persistent_surface_store() -&gt; std::shared_ptr&lt;mir::shell::PersistentSurfaceStore&gt;;
    auto get_mock_session()                  -&gt; std::shared_ptr&lt;mir::scene::Session&gt;;    
    
    std::shared_ptr&lt;mir::scene::Surface&gt;                   surfaces;
    std::shared_ptr&lt;mir::MainLoop&gt;                         main_loops;
    std::shared_ptr&lt;mir::scene::PromptSession&gt;             prompt_sessions;
    std::shared_ptr&lt;mir::shell::PersistentSurfaceStore&gt;    persistent_surface_stores;
    std::shared_ptr&lt;mir::scene::Session&gt;                   sessions;       
};
</code></pre>
<p dir="auto">The problem is that qtmir does not know the destructor of this objects, to they will have to be deleted inside miroil.<br />
Therefore I have added a reference in MockFactor to the objects. Which are deleted by MockFactory. This will only work if MockFactory is the last object to be deleted, so we have to make sure it is.</p>
<p dir="auto">So do you guys see any better solutions than this?</p>
]]></description><link>https://forums.ubports.com/post/51531</link><guid isPermaLink="true">https://forums.ubports.com/post/51531</guid><dc:creator><![CDATA[erlend]]></dc:creator><pubDate>Thu, 03 Jun 2021 11:07:35 GMT</pubDate></item><item><title><![CDATA[Reply to MirOil-for-Lomiri on Thu, 22 Apr 2021 11:16:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan_g" aria-label="Profile: alan_g">@<bdi>alan_g</bdi></a> Yes,Works.. Thank You!</p>
]]></description><link>https://forums.ubports.com/post/49923</link><guid isPermaLink="true">https://forums.ubports.com/post/49923</guid><dc:creator><![CDATA[erlend]]></dc:creator><pubDate>Thu, 22 Apr 2021 11:16:37 GMT</pubDate></item><item><title><![CDATA[Reply to MirOil-for-Lomiri on Thu, 22 Apr 2021 10:36:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/erlend" aria-label="Profile: erlend">@<bdi>erlend</bdi></a> said in <a href="/post/49917">MirOil-for-Lomiri</a>:</p>
<blockquote>
<p dir="auto">I still haven't got write permission to qtmir</p>
</blockquote>
<p dir="auto">Try now</p>
]]></description><link>https://forums.ubports.com/post/49918</link><guid isPermaLink="true">https://forums.ubports.com/post/49918</guid><dc:creator><![CDATA[alan_g]]></dc:creator><pubDate>Thu, 22 Apr 2021 10:36:39 GMT</pubDate></item><item><title><![CDATA[Reply to MirOil-for-Lomiri on Thu, 22 Apr 2021 09:57:37 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">I still haven't got write permission to qtmir... Need it to create a branch... I tried forking the project but that does not work since i have already forked ubports/qtmir. I can't fork it more that once.</p>
<p dir="auto">Can you fix that?</p>
]]></description><link>https://forums.ubports.com/post/49917</link><guid isPermaLink="true">https://forums.ubports.com/post/49917</guid><dc:creator><![CDATA[erlend]]></dc:creator><pubDate>Thu, 22 Apr 2021 09:57:37 GMT</pubDate></item><item><title><![CDATA[Reply to MirOil-for-Lomiri on Tue, 20 Apr 2021 15:22:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan_g" aria-label="Profile: alan_g">@<bdi>alan_g</bdi></a> Okey</p>
]]></description><link>https://forums.ubports.com/post/49845</link><guid isPermaLink="true">https://forums.ubports.com/post/49845</guid><dc:creator><![CDATA[erlend]]></dc:creator><pubDate>Tue, 20 Apr 2021 15:22:47 GMT</pubDate></item><item><title><![CDATA[Reply to MirOil-for-Lomiri on Tue, 20 Apr 2021 14:12:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/erlend" aria-label="Profile: erlend">@<bdi>erlend</bdi></a> don't wait for me.</p>
]]></description><link>https://forums.ubports.com/post/49842</link><guid isPermaLink="true">https://forums.ubports.com/post/49842</guid><dc:creator><![CDATA[alan_g]]></dc:creator><pubDate>Tue, 20 Apr 2021 14:12:24 GMT</pubDate></item><item><title><![CDATA[Reply to MirOil-for-Lomiri on Tue, 20 Apr 2021 13:37:21 GMT]]></title><description><![CDATA[<p dir="auto">Okey... Shall I wait until you have updated it to 20.04? or can I start now?<br />
What do you think?</p>
<p dir="auto">Github id is: 58894514 (erlend-g)</p>
]]></description><link>https://forums.ubports.com/post/49841</link><guid isPermaLink="true">https://forums.ubports.com/post/49841</guid><dc:creator><![CDATA[erlend]]></dc:creator><pubDate>Tue, 20 Apr 2021 13:37:21 GMT</pubDate></item><item><title><![CDATA[Reply to MirOil-for-Lomiri on Tue, 20 Apr 2021 13:01:47 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/erlend" aria-label="Profile: erlend">@<bdi>erlend</bdi></a>, thanks.</p>
<p dir="auto">Please make PRs and I'll review as I get time. And also sync the work back to upstream MirOil branch.</p>
<p dir="auto">I can also add you to the MirOil-for-Lomiri project to make that a little easier (need your github ID for that).</p>
<p dir="auto">I do want to do an update about this work as:</p>
<ol>
<li>it is now possible to use a 20.04 base using the <a href="http://repo2.ubports.com/" target="_blank" rel="noopener noreferrer nofollow ugc">http://repo2.ubports.com/</a> repository; and,</li>
<li>QtMir has migrated to gitlab (but I still need to sync with the right branch)</li>
</ol>
]]></description><link>https://forums.ubports.com/post/49839</link><guid isPermaLink="true">https://forums.ubports.com/post/49839</guid><dc:creator><![CDATA[alan_g]]></dc:creator><pubDate>Tue, 20 Apr 2021 13:01:47 GMT</pubDate></item><item><title><![CDATA[Reply to MirOil-for-Lomiri on Tue, 20 Apr 2021 12:19:32 GMT]]></title><description><![CDATA[<p dir="auto">Hi! I've started working on this... How should I work with this?</p>
<p dir="auto">Create a branch and then send you PR? Or push changes directly into miroil branch?</p>
<p dir="auto">Any way I don't have permission to push to a new branch....</p>
]]></description><link>https://forums.ubports.com/post/49838</link><guid isPermaLink="true">https://forums.ubports.com/post/49838</guid><dc:creator><![CDATA[erlend]]></dc:creator><pubDate>Tue, 20 Apr 2021 12:19:32 GMT</pubDate></item></channel></rss>