Package: release.debian.org
Severity: normal
Tags: trixie
X-Debbugs-Cc: [email protected]
Control: affects -1 + src:qtmir
User: [email protected]
Usertags: pu

Please accept a thoroughly tested upgrade to qtmir in Debian trixie.

[ Reason ]

+  * debian/patches:
+    + Add 0009_src-modules-Add-header-for-getpid.patch. Add include for 
getpid()
+      function.

Silence compiler warning.

+    + Add 0002_src-modules-Re-introduce-lost-workaround-for-font-re.patch.
+      Regression fix, fix arbitrary font rendering glitches. (LP:#1583088).

Regression fix that disappeared upsteam and landed there again after the
snapshot of qtmir we took for Debian. Without this patch, fonts start
being half/incompletely rendered in some situations.

+    + Add 0011_src-platforms-Wrap-window-activity-change-in-a-try-c.patch.
+      Selecting the active window can lead to a range exception, so avoid a
+      crash by wrapping this in a try-catch.

This increases robustness of Lomiri sessions (without it, they crash
from time to time for unknown reason (user perspective)).

+    + Add 0012_src-modules-Partial-revert-of-e73ef71622ad3202b77bf6.patch. Drop
+      overzealous code when removing a window.

Also increases Lomiri session robustness.

+    + Trivial rebase of 2003_disable-benchmarks.patch.
+    + Add 0022_modules-MirSurface-try-to-let-Mir-forceClose-dead-su.patch.
+      Attempt at forceClosing dead surfaces.

Without this patch, sometimes black areas remain on screen, originally
stemming from closed windows.

+    + Add 0031a_src-platforms-Select-GLRenderingProvider-based-on-su.patch and
+      0031b_src-platforms-fix-anonymous-call-for-C-20.patch. Support Lomiri on
+      Asahi Linux.

In cases someone uses Debian stable with Asahi Linux...

+    + Add 0033_src-platforms-Do-not-composite-again-on-running-comp.patch. 
Don't
+      crash when GRID_UNIT_PX is set to other values than 8. Fix scaling 
support
+      in Lomiri.

Fix scaling support of Lomiri. Where useful for Mobian or in general for
devices with many pixels on a small screen.

+    + Add 0034_src-platforms-Remove-guard-producing-dead-code-use-c.patch.
+      src/platforms: Remove guard producing dead code; use caching instead.

Performance improvement.

+    + Add 0035_src-platforms-Export-Xwayland-DISPLAY-to-systemd-and.patch.
+      src/platforms: Export Xwayland DISPLAY to systemd and DBus.

So that Wayland applications can access Xwayland when spawning
sub-processes that user X11 for rendering, not Wayland.

+    + Add 1001_do-not-focus-windows-on-touchdown-events.patch.
+      wrappedwindowmanagementpolicy: do not focus windows on touch down events.
+      Otherwise Mir will incorrectly focus the last opened window in Lomiri
+      spread.

This fixes a nasty bug when entering the spread (application
chooser/switcher) of Lomiri on a tablet. Without this patch, the spread
is nearly unusable when using touch input as apps lying under the spread
always gain focus when touch the spread view at places where the app is
underneath.

[ Impact ]
For Lomiri users only.

[ Tests ]
Unit tests at build time. Manual tests on local hardware (notebook, tablet) and 
in VM.

[ Risks ]
Other regressions in Lomiri.

[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in (old)stable
  [x] the issue is verified as fixed in unstable

[ Changes ]

See above under [ Reason ].

[ Other info ]
None.
diff -Nru qtmir-0.8.0~git20250407.ea2f477/debian/changelog 
qtmir-0.8.0~git20250407.ea2f477/debian/changelog
--- qtmir-0.8.0~git20250407.ea2f477/debian/changelog    2025-04-17 
21:25:11.000000000 +0200
+++ qtmir-0.8.0~git20250407.ea2f477/debian/changelog    2026-04-29 
10:42:12.000000000 +0200
@@ -1,3 +1,35 @@
+qtmir (0.8.0~git20250407.ea2f477-1+deb13u1) trixie; urgency=medium
+
+  * debian/patches:
+    + Add 0009_src-modules-Add-header-for-getpid.patch. Add include for 
getpid()
+      function.
+    + Add 0002_src-modules-Re-introduce-lost-workaround-for-font-re.patch.
+      Regression fix, fix arbitrary font rendering glitches. (LP:#1583088).
+    + Add 0011_src-platforms-Wrap-window-activity-change-in-a-try-c.patch.
+      Selecting the active window can lead to a range exception, so avoid a
+      crash by wrapping this in a try-catch.
+    + Add 0012_src-modules-Partial-revert-of-e73ef71622ad3202b77bf6.patch. Drop
+      overzealous code when removing a window.
+    + Trivial rebase of 2003_disable-benchmarks.patch.
+    + Add 0022_modules-MirSurface-try-to-let-Mir-forceClose-dead-su.patch.
+      Attempt at forceClosing dead surfaces.
+    + Add 0031a_src-platforms-Select-GLRenderingProvider-based-on-su.patch and
+      0031b_src-platforms-fix-anonymous-call-for-C-20.patch. Support Lomiri on
+      Asahi Linux.
+    + Add 0033_src-platforms-Do-not-composite-again-on-running-comp.patch. 
Don't
+      crash when GRID_UNIT_PX is set to other values than 8. Fix scaling 
support
+      in Lomiri.
+    + Add 0034_src-platforms-Remove-guard-producing-dead-code-use-c.patch.
+      src/platforms: Remove guard producing dead code; use caching instead.
+    + Add 0035_src-platforms-Export-Xwayland-DISPLAY-to-systemd-and.patch.
+      src/platforms: Export Xwayland DISPLAY to systemd and DBus.
+    + Add 1001_do-not-focus-windows-on-touchdown-events.patch.
+      wrappedwindowmanagementpolicy: do not focus windows on touch down events.
+      Otherwise Mir will incorrectly focus the last opened window in Lomiri
+      spread.
+
+ -- Mike Gabriel <[email protected]>  Wed, 29 Apr 2026 10:42:12 +0200
+
 qtmir (0.8.0~git20250407.ea2f477-1) unstable; urgency=medium
 
   * New upstream Git snapshot.
diff -Nru 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0002_src-modules-Re-introduce-lost-workaround-for-font-re.patch
 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0002_src-modules-Re-introduce-lost-workaround-for-font-re.patch
--- 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0002_src-modules-Re-introduce-lost-workaround-for-font-re.patch
      1970-01-01 01:00:00.000000000 +0100
+++ 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0002_src-modules-Re-introduce-lost-workaround-for-font-re.patch
      2026-04-29 10:42:12.000000000 +0200
@@ -0,0 +1,33 @@
+From b7333e0a00c2d7169c48e16b6e08c32803823fb4 Mon Sep 17 00:00:00 2001
+From: Alfred <[email protected]>
+Date: Thu, 11 Jul 2024 18:54:41 +0200
+Subject: [PATCH 02/14] src/modules: Re-introduce lost workaround for font
+ render issue
+
+Lost in commit b27b44772de3be476a05831c0f14a63f56d79378, pulled from
+revision 15fcc65039b19a598eda76e18260ea9824a13048 and placed in a
+similar place around buffer bindings happen.
+
+Signed-off-by: Mike Gabriel <[email protected]>
+---
+ src/modules/QtMir/Application/mirbuffersgtexture.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/modules/QtMir/Application/mirbuffersgtexture.cpp 
b/src/modules/QtMir/Application/mirbuffersgtexture.cpp
+index 47d9f03a..6397b528 100644
+--- a/src/modules/QtMir/Application/mirbuffersgtexture.cpp
++++ b/src/modules/QtMir/Application/mirbuffersgtexture.cpp
+@@ -135,6 +135,10 @@ public:
+         f->glBindTexture(GL_TEXTURE_2D, m_textureId);
+ 
+         m_texSourceBuf->bind();
++
++        // Fix for lp:1583088 - For non-GL clients, Mir uploads the client 
pixel buffer to a GL texture.
++        // But as it does so, it changes some GL state and neglects to 
restore it, which breaks Qt's rendering.
++        f->glPixelStorei(GL_UNPACK_ALIGNMENT, 4); // 4 is the default which 
Qt uses
+     }
+ 
+ private:
+-- 
+2.47.2
+
diff -Nru 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0009_src-modules-Add-header-for-getpid.patch
 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0009_src-modules-Add-header-for-getpid.patch
--- 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0009_src-modules-Add-header-for-getpid.patch
 1970-01-01 01:00:00.000000000 +0100
+++ 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0009_src-modules-Add-header-for-getpid.patch
 2026-04-29 10:42:12.000000000 +0200
@@ -0,0 +1,27 @@
+From e2af137c0e778e6e3c1440d0b782456793a9b5e3 Mon Sep 17 00:00:00 2001
+From: Alfred Neumayer <[email protected]>
+Date: Thu, 8 Aug 2024 22:04:41 +0200
+Subject: [PATCH 09/14] src/modules: Add header for getpid()
+
+Signed-off-by: Mike Gabriel <[email protected]>
+---
+ src/modules/QtMir/Application/application.cpp | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/modules/QtMir/Application/application.cpp 
b/src/modules/QtMir/Application/application.cpp
+index ef9e15cd..07d1aa92 100644
+--- a/src/modules/QtMir/Application/application.cpp
++++ b/src/modules/QtMir/Application/application.cpp
+@@ -36,6 +36,9 @@
+ // std
+ #include <csignal>
+ 
++// Linux
++#include <unistd.h>
++
+ namespace shellapp = lomiri::shell::application;
+ 
+ #define DEBUG_MSG qCDebug(QTMIR_APPLICATIONS).nospace() << "Application[" << 
appId() <<"]::" << __func__
+-- 
+2.47.2
+
diff -Nru 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0011_src-platforms-Wrap-window-activity-change-in-a-try-c.patch
 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0011_src-platforms-Wrap-window-activity-change-in-a-try-c.patch
--- 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0011_src-platforms-Wrap-window-activity-change-in-a-try-c.patch
      1970-01-01 01:00:00.000000000 +0100
+++ 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0011_src-platforms-Wrap-window-activity-change-in-a-try-c.patch
      2026-04-29 10:42:12.000000000 +0200
@@ -0,0 +1,54 @@
+From ca5e7399ca86280afcedf14f8ee5e09689c94abc Mon Sep 17 00:00:00 2001
+From: Alfred Neumayer <[email protected]>
+Date: Fri, 4 Jul 2025 10:49:52 +0200
+Subject: [PATCH 11/14] src/platforms: Wrap window activity change in a
+ try-catch
+
+Selecting the active window can lead to a range exception,
+so avoid a crash by wrapping this in a try-catch.
+
+Signed-off-by: Mike Gabriel <[email protected]>
+---
+ .../mirserver/wrappedwindowmanagementpolicy.cpp      | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/src/platforms/mirserver/wrappedwindowmanagementpolicy.cpp 
b/src/platforms/mirserver/wrappedwindowmanagementpolicy.cpp
+index b303b39f..d04813d3 100644
+--- a/src/platforms/mirserver/wrappedwindowmanagementpolicy.cpp
++++ b/src/platforms/mirserver/wrappedwindowmanagementpolicy.cpp
+@@ -619,7 +619,9 @@ void 
WrappedWindowManagementPolicy::deliver_keyboard_event(const MirKeyboardEven
+     if (mir_keyboard_event_action(event) == mir_keyboard_action_down) {
+         tools.invoke_under_lock([&]() {
+             if (tools.active_window() != window) {
+-                tools.select_active_window(window);
++                try {
++                    tools.select_active_window(window);
++                } catch (const std::exception& e) { }
+             }
+         });
+     }
+@@ -631,7 +633,9 @@ void 
WrappedWindowManagementPolicy::deliver_touch_event(const MirTouchEvent *eve
+ {
+     tools.invoke_under_lock([&]() {
+         if (tools.active_window() != window) {
+-            tools.select_active_window(window);
++            try {
++                tools.select_active_window(window);
++            } catch (const std::exception& e) { }
+         }
+     });
+ 
+@@ -644,7 +648,9 @@ void 
WrappedWindowManagementPolicy::deliver_pointer_event(const MirPointerEvent
+     if (mir_pointer_event_action(event) == mir_pointer_action_button_down) {
+         tools.invoke_under_lock([&]() {
+             if (tools.active_window() != window) {
+-                tools.select_active_window(window);
++                try {
++                    tools.select_active_window(window);
++                } catch (const std::exception& e) { }
+             }
+         });
+     }
+-- 
+2.47.2
+
diff -Nru 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0012_src-modules-Partial-revert-of-e73ef71622ad3202b77bf6.patch
 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0012_src-modules-Partial-revert-of-e73ef71622ad3202b77bf6.patch
--- 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0012_src-modules-Partial-revert-of-e73ef71622ad3202b77bf6.patch
      1970-01-01 01:00:00.000000000 +0100
+++ 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0012_src-modules-Partial-revert-of-e73ef71622ad3202b77bf6.patch
      2026-04-29 10:42:12.000000000 +0200
@@ -0,0 +1,38 @@
+From c6bee71ba608570ca8417399f32f5f5cf7796f0a Mon Sep 17 00:00:00 2001
+From: Alfred Neumayer <[email protected]>
+Date: Tue, 22 Jul 2025 12:47:38 +0200
+Subject: [PATCH 12/14] src/modules: Partial revert of
+ e73ef71622ad3202b77bf6005f73134726d6394a
+
+Signed-off-by: Mike Gabriel <[email protected]>
+---
+ src/modules/QtMir/Application/windowmodel.cpp | 11 ++---------
+ 1 file changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/src/modules/QtMir/Application/windowmodel.cpp 
b/src/modules/QtMir/Application/windowmodel.cpp
+index c95adc73..0d65d7f5 100644
+--- a/src/modules/QtMir/Application/windowmodel.cpp
++++ b/src/modules/QtMir/Application/windowmodel.cpp
+@@ -81,17 +81,10 @@ void WindowModel::onWindowAdded(const NewWindow &window)
+     beginInsertRows(QModelIndex(), index, index);
+ 
+ #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(2, 20, 0)
+-    auto mirSurface = new MirSurface(window, m_windowController, 
*m_glProvider);
++    m_windowModel.append(new MirSurface(window, m_windowController, 
*m_glProvider));
+ #else
+-    auto mirSurface = new MirSurface(window, m_windowController);
++    m_windowModel.append(new MirSurface(window, m_windowController));
+ #endif
+-    connect(mirSurface, &MirSurface::isBeingDisplayedChanged, this, [=, 
this](){
+-        if (mirSurface->isBeingDisplayed())
+-            return;
+-        onWindowRemoved(window.windowInfo);
+-    });
+-
+-    m_windowModel.append(mirSurface);
+     endInsertRows();
+     Q_EMIT countChanged();
+ }
+-- 
+2.47.2
+
diff -Nru 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0022_modules-MirSurface-try-to-let-Mir-forceClose-dead-su.patch
 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0022_modules-MirSurface-try-to-let-Mir-forceClose-dead-su.patch
--- 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0022_modules-MirSurface-try-to-let-Mir-forceClose-dead-su.patch
      1970-01-01 01:00:00.000000000 +0100
+++ 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0022_modules-MirSurface-try-to-let-Mir-forceClose-dead-su.patch
      2026-04-29 10:42:12.000000000 +0200
@@ -0,0 +1,66 @@
+From e5f9beaa005962c890a5aa535f8efb8ed4f3d7d6 Mon Sep 17 00:00:00 2001
+From: Ratchanan Srirattanamet <[email protected]>
+Date: Fri, 1 Aug 2025 21:02:09 +0700
+Subject: [PATCH 2/2] modules/MirSurface: try to let Mir forceClose dead
+ surface close timeout
+
+This is the last-ditch attempt on this weird behavior. This really a
+workaround; we still have to figure out what actually happen.
+
+Signed-off-by: Mike Gabriel <[email protected]>
+---
+ src/modules/QtMir/Application/mirsurface.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+--- a/src/modules/QtMir/Application/mirsurface.cpp
++++ b/src/modules/QtMir/Application/mirsurface.cpp
+@@ -1203,11 +1203,10 @@
+                 // to kill the app.
+                 // ref https://github.com/ubports/ubuntu-touch/issues/1417
+                 WARNING_MSG << "(), app with ID " << app->appId() << " has " 
<<
+-                    "ignored request to close a window. Tearing down window. 
" <<
+-                    "This could be a bug in the application.";
+-                //app->terminate();
+-                teardown();
+-            } // TODO: Investigate phone/desktop split
++                    "ignored request to close a window. Terminating the " <<
++                    "application. This could be a bug in the application.";
++                app->terminate();
++            }
+         } else {
+             // Weird zombie surface. Removing it may still cause problems 
later
+             // since this should almost never occur.
+@@ -1216,11 +1215,30 @@
+             m_controller->forceClose(m_window);
+         }
+     } else {
+-        WARNING_MSG << "Surface not live anymore, tearing down.";
+-        teardown();
++        // In case this is a weird combie process, just try to remove the 
application it was related to
++        if (m_session && m_session->application()) {
++            Application *app = 
static_cast<Application*>(m_session->application());
++
++            WARNING_MSG << "(), app with ID " << app->appId() << " has " <<
++                    "ignored request to close a window. Maybe it is dead 
already?" <<
++                    "Terminating the application anyway.";
++            app->terminate();
++        } else {
++            WARNING_MSG << "() object is still alive despite being not live "
++                    "and has no session. Something hold us up? Will now try 
to "
++                    "ask Mir to force close this surface. Expect strange "
++                    "behavior.";
++
++            try {
++                m_controller->forceClose(m_window);
++            } catch (const std::out_of_range&) {
++                WARNING_MSG << "() and Mir doesn't even have this surface "
++                        "anymore. What on earth is happenning???";
++                // At this point there's nothing else we can do...
++            }
++        }
+     }
+ }
+-
+ void MirSurface::setCloseTimer(AbstractTimer *timer)
+ {
+     bool timerWasRunning = false;
diff -Nru 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0031a_src-platforms-Select-GLRenderingProvider-based-on-su.patch
 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0031a_src-platforms-Select-GLRenderingProvider-based-on-su.patch
--- 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0031a_src-platforms-Select-GLRenderingProvider-based-on-su.patch
     1970-01-01 01:00:00.000000000 +0100
+++ 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0031a_src-platforms-Select-GLRenderingProvider-based-on-su.patch
     2026-04-29 10:42:12.000000000 +0200
@@ -0,0 +1,127 @@
+From f07982e5b4b3d04dca9245e7cdd8f0a6ba19168a Mon Sep 17 00:00:00 2001
+From: Alfred Neumayer <[email protected]>
+Date: Tue, 20 May 2025 10:03:12 +0200
+Subject: [PATCH] src: platforms: Select GLRenderingProvider based on
+ suitability
+
+Only if the display_sink can handle the output should it be used.
+In order to achieve this, store the list of available rendering
+providers and select the right one based on suitability later on,
+when the display buffer is hooked to the actual screen.
+
+Fixes rendering provider selection on Asahi Linux.
+---
+ src/platforms/mirserver/qmirserver_p.cpp | 11 ++++++----
+ src/platforms/mirserver/screensmodel.cpp | 28 +++++++++++++++++++++---
+ src/platforms/mirserver/screensmodel.h   |  6 +++--
+ 3 files changed, 36 insertions(+), 9 deletions(-)
+
+diff --git a/src/platforms/mirserver/qmirserver_p.cpp 
b/src/platforms/mirserver/qmirserver_p.cpp
+index 3aef77d8..b2843d65 100644
+--- a/src/platforms/mirserver/qmirserver_p.cpp
++++ b/src/platforms/mirserver/qmirserver_p.cpp
+@@ -258,7 +258,7 @@ void QMirServerPrivate::run(const std::function<void()> 
&startCallback)
+                     return result;
+                 }
+                 ,
+-                // Initialization called by mir when the new compositor is 
setup up              
++                // Initialization called by mir when the new compositor is 
setup up
+                     [this](const std::shared_ptr<mir::graphics::Display>& 
display,
+ #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(2, 20, 0)
+                            const 
std::vector<std::shared_ptr<mir::graphics::GLRenderingProvider>> 
render_providers,
+@@ -267,10 +267,13 @@ void QMirServerPrivate::run(const std::function<void()> 
&startCallback)
+                            const 
std::shared_ptr<mir::compositor::DisplayListener>& displayListener)
+                 {
+                     std::shared_ptr<QtCompositor> qtCompsitor = 
std::dynamic_pointer_cast<QtCompositor>(compositor);
+-                    
++                    qCDebug(QTMIR_MIR_MESSAGES) << "Initializing screens 
model";
+ #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(2, 20, 0)
+-                    this->renderingProvider = render_providers.front();
+-                    this->screensModel->init(display, renderingProvider, 
qtCompsitor, std::make_shared<miroil::DisplayListenerWrapper>(displayListener));
++                    auto callback = 
[=](std::shared_ptr<mir::graphics::GLRenderingProvider> provider) {
++                        this->renderingProvider = provider;
++                        qCDebug(QTMIR_MIR_MESSAGES) << "renderingProvider 
set";
++                    };
++                    this->screensModel->init(display, render_providers, 
callback, qtCompsitor, 
std::make_shared<miroil::DisplayListenerWrapper>(displayListener));
+ #else
+                     this->screensModel->init(display, qtCompsitor, 
std::make_shared<miroil::DisplayListenerWrapper>(displayListener));
+ #endif
+diff --git a/src/platforms/mirserver/screensmodel.cpp 
b/src/platforms/mirserver/screensmodel.cpp
+index f89dcac4..8998d06d 100644
+--- a/src/platforms/mirserver/screensmodel.cpp
++++ b/src/platforms/mirserver/screensmodel.cpp
+@@ -58,14 +58,16 @@ ScreensModel::ScreensModel([[maybe_unused]]QObject *parent)
+ void ScreensModel::init(
+     const std::shared_ptr<mir::graphics::Display>& display,
+ #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(2, 20, 0)
+-    std::shared_ptr<mir::graphics::GLRenderingProvider> glProvider,
++    const std::vector<std::shared_ptr<mir::graphics::GLRenderingProvider>> 
renderProviders,
++    std::function<void(std::shared_ptr<mir::graphics::GLRenderingProvider>)> 
callback,
+ #endif
+     const std::shared_ptr<QtCompositor>& compositor,
+     const std::shared_ptr<miroil::DisplayListenerWrapper>& displayListener)
+ {
+     m_display = display;
+ #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(2, 20, 0)
+-    m_glProvider = std::move(glProvider);
++    m_glProviders = renderProviders;
++    m_renderProviderSetupCallback = callback;
+ #endif
+     m_compositor = compositor;
+     m_displayListener = displayListener;
+@@ -203,7 +205,27 @@ void ScreensModel::updateInternal()
+ 
+             Q_FOREACH (auto screen, m_screenList) {
+                 if (dbGeom == screen->geometry()) {
+-                    screen->setMirDisplaySink(*m_glProvider, &sink, &group);
++                    // Find suitable glProvider
++                    std::pair<mg::probe::Result, 
std::shared_ptr<mg::GLRenderingProvider>> best_provider = 
std::make_pair(mg::probe::unsupported, nullptr);
++
++                    qCDebug(QTMIR_SCREENS) << "() - render providers=" << 
m_glProviders.size();
++                    for (auto const& provider : m_glProviders)
++                    {
++                        auto suitability = 
provider->suitability_for_display(sink);
++                        if (suitability > best_provider.first)
++                        {
++                            best_provider = std::make_pair(suitability, 
provider);
++                        }
++                    }
++
++                    if (best_provider.first == mg::probe::unsupported)
++                    {
++                        BOOST_THROW_EXCEPTION((std::logic_error{"No rendering 
platform claims to support this output"}));
++                    }
++
++                    auto const chosen_provider = best_provider.second;
++                    m_renderProviderSetupCallback(chosen_provider);
++                    screen->setMirDisplaySink(*chosen_provider, &sink, 
&group);
+                     break;
+                 }
+             }
+diff --git a/src/platforms/mirserver/screensmodel.h 
b/src/platforms/mirserver/screensmodel.h
+index 55b131ba..b4d1a2a2 100644
+--- a/src/platforms/mirserver/screensmodel.h
++++ b/src/platforms/mirserver/screensmodel.h
+@@ -87,7 +87,8 @@ public:
+     void init(
+         const std::shared_ptr<mir::graphics::Display>& display,
+ #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(2, 20, 0)
+-        std::shared_ptr<mir::graphics::GLRenderingProvider> glProvider,
++        const 
std::vector<std::shared_ptr<mir::graphics::GLRenderingProvider>> 
render_providers,
++        
std::function<void(std::shared_ptr<mir::graphics::GLRenderingProvider>)> 
callback,
+ #endif
+         const std::shared_ptr<QtCompositor>& compositor,
+         const std::shared_ptr<miroil::DisplayListenerWrapper> & 
displayListener);
+@@ -111,7 +112,8 @@ private:
+     std::shared_ptr<QtCompositor> m_compositor;
+     std::shared_ptr<miroil::DisplayListenerWrapper> m_displayListener;
+ #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(2, 20, 0)
+-    std::shared_ptr<mir::graphics::GLRenderingProvider> m_glProvider;
++    std::vector<std::shared_ptr<mir::graphics::GLRenderingProvider>> 
m_glProviders;
++    std::function<void(std::shared_ptr<mir::graphics::GLRenderingProvider>)> 
m_renderProviderSetupCallback;
+ #endif
+     QList<PlatformScreen*> m_screenList;
+     bool m_compositing;
+-- 
+2.47.3
+
diff -Nru 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0031b_src-platforms-fix-anonymous-call-for-C-20.patch
 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0031b_src-platforms-fix-anonymous-call-for-C-20.patch
--- 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0031b_src-platforms-fix-anonymous-call-for-C-20.patch
        1970-01-01 01:00:00.000000000 +0100
+++ 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0031b_src-platforms-fix-anonymous-call-for-C-20.patch
        2026-04-29 10:42:12.000000000 +0200
@@ -0,0 +1,25 @@
+From 9f6fcfa699885652adec42c0feb0fe26ffb0333d Mon Sep 17 00:00:00 2001
+From: Azkali Manad <[email protected]>
+Date: Sun, 8 Feb 2026 14:00:48 +0700
+Subject: [PATCH] src: platforms: fix anonymous call for C++20
+
+---
+ src/platforms/mirserver/qmirserver_p.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/platforms/mirserver/qmirserver_p.cpp 
b/src/platforms/mirserver/qmirserver_p.cpp
+index b2843d65..126cff89 100644
+--- a/src/platforms/mirserver/qmirserver_p.cpp
++++ b/src/platforms/mirserver/qmirserver_p.cpp
+@@ -269,7 +269,7 @@ void QMirServerPrivate::run(const std::function<void()> 
&startCallback)
+                     std::shared_ptr<QtCompositor> qtCompsitor = 
std::dynamic_pointer_cast<QtCompositor>(compositor);
+                     qCDebug(QTMIR_MIR_MESSAGES) << "Initializing screens 
model";
+ #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(2, 20, 0)
+-                    auto callback = 
[=](std::shared_ptr<mir::graphics::GLRenderingProvider> provider) {
++                    auto callback = [=, 
this](std::shared_ptr<mir::graphics::GLRenderingProvider> provider) {
+                         this->renderingProvider = provider;
+                         qCDebug(QTMIR_MIR_MESSAGES) << "renderingProvider 
set";
+                     };
+-- 
+2.47.3
+
diff -Nru 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0033_src-platforms-Do-not-composite-again-on-running-comp.patch
 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0033_src-platforms-Do-not-composite-again-on-running-comp.patch
--- 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0033_src-platforms-Do-not-composite-again-on-running-comp.patch
      1970-01-01 01:00:00.000000000 +0100
+++ 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0033_src-platforms-Do-not-composite-again-on-running-comp.patch
      2026-04-29 10:42:12.000000000 +0200
@@ -0,0 +1,53 @@
+From 58a62d2f9df559cb084a3243aafbd52098e78210 Mon Sep 17 00:00:00 2001
+From: Azkali Manad <[email protected]>
+Date: Sun, 8 Feb 2026 14:20:37 +0700
+Subject: [PATCH] src: platforms: Do not composite again on running compositor
+ also compare scaled logical size with physical size as sometime the logical
+ size is not correctly mapped during init
+
+---
+ src/platforms/mirserver/screensmodel.cpp | 21 ++++++++++++++++++++-
+ 1 file changed, 20 insertions(+), 1 deletion(-)
+
+diff --git a/src/platforms/mirserver/screensmodel.cpp 
b/src/platforms/mirserver/screensmodel.cpp
+index ab0b78c3..b5ab1256 100644
+--- a/src/platforms/mirserver/screensmodel.cpp
++++ b/src/platforms/mirserver/screensmodel.cpp
+@@ -125,6 +125,11 @@ void ScreensModel::updateInternal()
+ {
+     DEBUG_MSG << "()";
+ 
++    if (m_compositing) {
++        DEBUG_MSG << "updateInternal() ignored while compositing";
++        return;
++    }
++
+     const bool wasCompositing = m_compositing;
+ 
+     auto display = m_display.lock();
+@@ -204,7 +209,21 @@ void ScreensModel::updateInternal()
+                          sink.view_area().size.height.as_int());
+ 
+             Q_FOREACH (auto screen, m_screenList) {
+-                if (dbGeom == screen->geometry()) {
++                QSize logical = screen->geometry().size();
++                qreal scale = screen->scale();
++
++                QRect physical(
++                    screen->geometry().x(),
++                    screen->geometry().y(),
++                    logical.width() / scale,
++                    logical.height() / scale
++                );
++
++                qCDebug(QTMIR_SCREENS) << "Comparing sink physical geom" << 
dbGeom
++                           << "to screen physical geom" << physical;
++
++                if (dbGeom == physical)
++                {
+                     // Find suitable glProvider
+                     std::pair<mg::probe::Result, 
std::shared_ptr<mg::GLRenderingProvider>> best_provider = 
std::make_pair(mg::probe::unsupported, nullptr);
+ 
+-- 
+2.47.3
+
diff -Nru 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0034_src-platforms-Remove-guard-producing-dead-code-use-c.patch
 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0034_src-platforms-Remove-guard-producing-dead-code-use-c.patch
--- 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0034_src-platforms-Remove-guard-producing-dead-code-use-c.patch
      1970-01-01 01:00:00.000000000 +0100
+++ 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0034_src-platforms-Remove-guard-producing-dead-code-use-c.patch
      2026-04-29 10:42:12.000000000 +0200
@@ -0,0 +1,63 @@
+From ba38a00b3eba6822b0c27c0f05729f44dfb10f33 Mon Sep 17 00:00:00 2001
+From: Azkali <[email protected]>
+Date: Mon, 16 Feb 2026 09:14:39 +0700
+Subject: [PATCH] src: platforms: Remove guard producing dead code; use caching
+ instead
+
+---
+ src/platforms/mirserver/platformscreen.cpp | 9 +++++++--
+ src/platforms/mirserver/platformscreen.h   | 1 +
+ src/platforms/mirserver/screensmodel.cpp   | 5 -----
+ 3 files changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/src/platforms/mirserver/platformscreen.cpp 
b/src/platforms/mirserver/platformscreen.cpp
+index d27ce391..eb73aa08 100644
+--- a/src/platforms/mirserver/platformscreen.cpp
++++ b/src/platforms/mirserver/platformscreen.cpp
+@@ -490,8 +490,13 @@ void PlatformScreen::removeWindow(ScreenPlatformWindow 
*window)
+ #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(2, 20, 0)
+ void PlatformScreen::setMirDisplaySink(mir::graphics::GLRenderingProvider 
&glProvider, mir::graphics::DisplaySink *sink, mir::graphics::DisplaySyncGroup 
*group)
+ {
+-    m_outputSurface = glProvider.surface_for_sink(*sink, MirGLConfig{});
+-    DEBUG_MSG_SCREENS << "(outputSurface=" << m_outputSurface.get() << ", 
outputSink=" << sink <<  ", displayGroup=" << group << ")";
++    if (sink != m_lastDisplaySink) {
++        m_outputSurface = glProvider.surface_for_sink(*sink, MirGLConfig{});
++        m_lastDisplaySink = sink;
++        DEBUG_MSG_SCREENS << "(outputSurface=" << m_outputSurface.get() << ", 
outputSink=" << sink <<  ", displayGroup=" << group << ") [new sink]";
++    } else {
++        DEBUG_MSG_SCREENS << "(outputSurface=" << m_outputSurface.get() << ", 
outputSink=" << sink <<  ", displayGroup=" << group << ") [cached sink]";
++    }
+     // This operation should only be performed while rendering is stopped
+     m_displaySink = sink;
+     m_displayGroup = group;
+diff --git a/src/platforms/mirserver/platformscreen.h 
b/src/platforms/mirserver/platformscreen.h
+index be78e68e..66657d16 100644
+--- a/src/platforms/mirserver/platformscreen.h
++++ b/src/platforms/mirserver/platformscreen.h
+@@ -174,6 +174,7 @@ private:
+ #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(2, 20, 0)
+     std::unique_ptr<mir::graphics::gl::OutputSurface> m_outputSurface;
+     mir::graphics::DisplaySink *m_displaySink;
++    mir::graphics::DisplaySink *m_lastDisplaySink = nullptr;
+ #else
+     mir::renderer::gl::RenderTarget *m_renderTarget;
+ #endif
+diff --git a/src/platforms/mirserver/screensmodel.cpp 
b/src/platforms/mirserver/screensmodel.cpp
+index b5ab1256..7f8962c6 100644
+--- a/src/platforms/mirserver/screensmodel.cpp
++++ b/src/platforms/mirserver/screensmodel.cpp
+@@ -125,11 +125,6 @@ void ScreensModel::updateInternal()
+ {
+     DEBUG_MSG << "()";
+ 
+-    if (m_compositing) {
+-        DEBUG_MSG << "updateInternal() ignored while compositing";
+-        return;
+-    }
+-
+     const bool wasCompositing = m_compositing;
+ 
+     auto display = m_display.lock();
+-- 
+2.47.3
+
diff -Nru 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0035_src-platforms-Export-Xwayland-DISPLAY-to-systemd-and.patch
 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0035_src-platforms-Export-Xwayland-DISPLAY-to-systemd-and.patch
--- 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0035_src-platforms-Export-Xwayland-DISPLAY-to-systemd-and.patch
      1970-01-01 01:00:00.000000000 +0100
+++ 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/0035_src-platforms-Export-Xwayland-DISPLAY-to-systemd-and.patch
      2026-04-29 10:42:12.000000000 +0200
@@ -0,0 +1,65 @@
+From da88a93e5abdf4e78c3758391f95ce7a93672032 Mon Sep 17 00:00:00 2001
+From: Alfred Neumayer <[email protected]>
+Date: Tue, 24 Feb 2026 00:24:55 +0100
+Subject: [PATCH] src/platforms: Export Xwayland DISPLAY to systemd and DBus
+
+Xwayland apps launched from the OpenStore app either don't spawn or
+crash the shell when DISPLAY is not inherited into the app's environment.
+Export DISPLAY to systemd and dbus-daemon over DBus.
+---
+ src/platforms/mirserver/qmirserver_p.cpp | 25 +++++++++++++++++++++++-
+ 1 file changed, 24 insertions(+), 1 deletion(-)
+
+diff --git a/src/platforms/mirserver/qmirserver_p.cpp 
b/src/platforms/mirserver/qmirserver_p.cpp
+index 126cff89..db192d09 100644
+--- a/src/platforms/mirserver/qmirserver_p.cpp
++++ b/src/platforms/mirserver/qmirserver_p.cpp
+@@ -51,6 +51,9 @@
+ 
+ // Qt
+ #include <QCoreApplication>
++#include <QDBusConnection>
++#include <QDBusInterface>
++#include <QMap>
+ #include <QOpenGLContext>
+ 
+ #ifdef WITH_VALGRIND
+@@ -166,6 +169,23 @@ qtmir::PromptSessionListener 
*QMirServerPrivate::promptSessionListener() const
+     return 
dynamic_cast<qtmir::PromptSessionListener*>(m_mirServerHooks.the_prompt_session_listener());
+ }
+ 
++inline void exportEnvVarToDbus(const std::string& key, const std::string& 
value)
++{
++    QDBusInterface dbusDaemon("org.freedesktop.DBus", "/org/freedesktop/DBus",
++                              "org.freedesktop.DBus", 
QDBusConnection::sessionBus());
++    QVariantMap pair;
++    pair.insert(QString::fromStdString(key), QString::fromStdString(value));
++    dbusDaemon.call("UpdateActivationEnvironment", pair);
++}
++
++inline void exportEnvVarToSystemd(const std::string& key, const std::string& 
value)
++{
++    QDBusInterface sdManager("org.freedesktop.systemd1", 
"/org/freedesktop/systemd1",
++                             "org.freedesktop.systemd1.Manager", 
QDBusConnection::sessionBus());
++    const QString pair = QString::fromStdString(key) + QStringLiteral("=") + 
QString::fromStdString(value);
++    sdManager.call("SetEnvironment", QStringList() << pair);
++}
++
+ void QMirServerPrivate::run(const std::function<void()> &startCallback)
+ {
+     
m_mirServerHooks.create_prompt_session_listener(std::dynamic_pointer_cast<miroil::PromptSessionListener>(std::make_shared<qtmir::PromptSessionListener>()));
+@@ -211,7 +231,10 @@ void QMirServerPrivate::run(const std::function<void()> 
&startCallback)
+         m_mirServerHooks.create_input_device_observer(ptr);
+         if (auto const x11_display = runner.x11_display())
+         {
+-            setenv("DISPLAY", x11_display.value().c_str(), 1);
++            const auto displayVar = x11_display.value();
++            setenv("DISPLAY", displayVar.c_str(), 1);
++            exportEnvVarToDbus("DISPLAY", displayVar);
++            exportEnvVarToSystemd("DISPLAY", displayVar);
+         }
+     });
+ 
+-- 
+2.47.3
+
diff -Nru 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/1001_do-not-focus-windows-on-touchdown-events.patch
 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/1001_do-not-focus-windows-on-touchdown-events.patch
--- 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/1001_do-not-focus-windows-on-touchdown-events.patch
  1970-01-01 01:00:00.000000000 +0100
+++ 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/1001_do-not-focus-windows-on-touchdown-events.patch
  2026-04-29 10:42:12.000000000 +0200
@@ -0,0 +1,27 @@
+From 24957a350db35e6712bf4ee78b07cc0471428373 Mon Sep 17 00:00:00 2001
+From: Muhammad <[email protected]>
+Date: Thu, 16 Apr 2026 01:31:42 +0500
+Subject: [PATCH] wrappedwindowmanagementpolicy: do not focus windows on touch
+ down event
+
+otherwise Mir will incorrectly focus the last opened window in Lomiri
+spread
+
+Signed-off-by: Muhammad <[email protected]>
+---
+ src/platforms/mirserver/wrappedwindowmanagementpolicy.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/src/platforms/mirserver/wrappedwindowmanagementpolicy.cpp
++++ b/src/platforms/mirserver/wrappedwindowmanagementpolicy.cpp
+@@ -270,7 +270,9 @@
+ 
+     bool WindowManagementPolicy::handle_touch_event(const MirTouchEvent 
*event)
+     {
+-        MinimalWindowManager::handle_touch_event(event);
++        if (mir_touch_event_action(event, 0) != mir_touch_action_down) {
++            MinimalWindowManager::handle_touch_event(event);
++        }
+ 
+         d->m_eventFeeder->dispatchTouch(event);
+         return true;
diff -Nru 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/2003_disable-benchmarks.patch 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/2003_disable-benchmarks.patch
--- 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/2003_disable-benchmarks.patch    
    2024-02-14 10:33:36.000000000 +0100
+++ 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/2003_disable-benchmarks.patch    
    2026-04-29 10:42:12.000000000 +0200
@@ -3,7 +3,7 @@
 
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -184,5 +184,5 @@
+@@ -185,5 +185,5 @@
  # add subdirectories to build
  add_subdirectory(src)
  add_subdirectory(demos)
diff -Nru qtmir-0.8.0~git20250407.ea2f477/debian/patches/series 
qtmir-0.8.0~git20250407.ea2f477/debian/patches/series
--- qtmir-0.8.0~git20250407.ea2f477/debian/patches/series       2025-02-28 
14:46:20.000000000 +0100
+++ qtmir-0.8.0~git20250407.ea2f477/debian/patches/series       2026-04-29 
10:42:12.000000000 +0200
@@ -1,2 +1,13 @@
 2002_no-requires-provides-check.patch
 2003_disable-benchmarks.patch
+0002_src-modules-Re-introduce-lost-workaround-for-font-re.patch
+0009_src-modules-Add-header-for-getpid.patch
+0011_src-platforms-Wrap-window-activity-change-in-a-try-c.patch
+0012_src-modules-Partial-revert-of-e73ef71622ad3202b77bf6.patch
+0022_modules-MirSurface-try-to-let-Mir-forceClose-dead-su.patch
+0031a_src-platforms-Select-GLRenderingProvider-based-on-su.patch
+0031b_src-platforms-fix-anonymous-call-for-C-20.patch
+0033_src-platforms-Do-not-composite-again-on-running-comp.patch
+0034_src-platforms-Remove-guard-producing-dead-code-use-c.patch
+0035_src-platforms-Export-Xwayland-DISPLAY-to-systemd-and.patch
+1001_do-not-focus-windows-on-touchdown-events.patch

Reply via email to