mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-18 23:22:24 +01:00
Pick some patches to fix compile errors with Mir 2.22:
* https://gitlab.com/ubports/development/core/qtmir/-/merge_requests/101
* 7e3001f354
131 lines
4.4 KiB
Diff
131 lines
4.4 KiB
Diff
From 97155294fb44c95b305f3aebe98d9e29bbd398fc Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Micha=C5=82=20Sawicz?= <michal@sawicz.net>
|
|
Date: Thu, 4 Sep 2025 09:19:11 +0200
|
|
Subject: [PATCH 1/3] mirserver: update for Mir 2.22
|
|
|
|
---
|
|
include/miroil/edid.h | 27 ----------------------
|
|
src/platforms/mirserver/platformscreen.cpp | 8 +++++++
|
|
2 files changed, 8 insertions(+), 27 deletions(-)
|
|
|
|
diff --git a/include/miroil/edid.h b/include/miroil/edid.h
|
|
index ec5996e5..fcd197a5 100644
|
|
--- a/include/miroil/edid.h
|
|
+++ b/include/miroil/edid.h
|
|
@@ -34,33 +34,6 @@ struct Edid
|
|
|
|
struct PhysicalSizeMM { int width; int height; };
|
|
PhysicalSizeMM size{0,0};
|
|
-
|
|
- struct Descriptor {
|
|
- enum class Type : uint8_t {
|
|
- timing_identifiers = 0xfa,
|
|
- white_point_data = 0xfb,
|
|
- monitor_name = 0xfc,
|
|
- monitor_limits = 0xfd,
|
|
- unspecified_text = 0xfe,
|
|
- serial_number = 0xff,
|
|
-
|
|
- undefined = 0x00,
|
|
- };
|
|
-
|
|
- union Value {
|
|
- char monitor_name[13];
|
|
- char unspecified_text[13];
|
|
- char serial_number[13];
|
|
- };
|
|
-
|
|
- Type type{Type::undefined};
|
|
- Value value{{0}};
|
|
-
|
|
- std::string string_value() const;
|
|
- };
|
|
- Descriptor descriptors[4];
|
|
-
|
|
- Edid& parse_data(std::vector<uint8_t> const&);
|
|
};
|
|
|
|
}
|
|
diff --git a/src/platforms/mirserver/platformscreen.cpp b/src/platforms/mirserver/platformscreen.cpp
|
|
index d27ce391..ff6bc495 100644
|
|
--- a/src/platforms/mirserver/platformscreen.cpp
|
|
+++ b/src/platforms/mirserver/platformscreen.cpp
|
|
@@ -260,11 +260,19 @@ void PlatformScreen::setMirDisplayConfiguration(const mir::graphics::DisplayConf
|
|
|
|
// Output data - each output has a unique id and corresponding type. Can be multiple cards.
|
|
m_displayId.output_id = screen.id;
|
|
+
|
|
+#if MIR_SERVER_VERSION < MIR_VERSION_NUMBER(2, 22, 0)
|
|
try {
|
|
m_displayId.edid.parse_data(reinterpret_cast<std::vector<uint8_t> const&>(screen.edid));
|
|
} catch (std::runtime_error const& e) {
|
|
printf("Failed to parse EDID - %s\n", e.what());
|
|
}
|
|
+#else
|
|
+ m_displayId.edid.vendor = screen.display_info.vendor.value_or("");
|
|
+ m_displayId.edid.product_code = screen.display_info.product_code.value_or(0);
|
|
+ m_displayId.edid.serial_number = screen.display_info.serial_number.value_or(0);
|
|
+ m_displayId.edid.size = {screen.physical_size_mm.width.as_int(), screen.physical_size_mm.height.as_int()};
|
|
+#endif
|
|
|
|
auto type = static_cast<qtmir::OutputTypes>(screen.type); //FIXME: need compile time check these are equivalent
|
|
if (m_type != type) {
|
|
--
|
|
GitLab
|
|
|
|
|
|
From 8e928fa3b10463ba1b60bd997fce84098e88b419 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Micha=C5=82=20Sawicz?= <michal@sawicz.net>
|
|
Date: Fri, 12 Sep 2025 18:41:08 +0200
|
|
Subject: [PATCH 2/3] demos: drop usage of deprecated `Descriptor`s
|
|
|
|
---
|
|
demos/qtmir-demo-shell/main.cpp | 3 ---
|
|
1 file changed, 3 deletions(-)
|
|
|
|
diff --git a/demos/qtmir-demo-shell/main.cpp b/demos/qtmir-demo-shell/main.cpp
|
|
index 2a5a6a33..4d36d6f8 100644
|
|
--- a/demos/qtmir-demo-shell/main.cpp
|
|
+++ b/demos/qtmir-demo-shell/main.cpp
|
|
@@ -43,9 +43,6 @@ inline QString stringFromEdid(const miroil::Edid& edid)
|
|
str += QString::fromStdString(edid.vendor);
|
|
str += QString("%1%2").arg(edid.product_code).arg(edid.serial_number);
|
|
|
|
- for (int i = 0; i < 4; i++) {
|
|
- str += QString::fromStdString(edid.descriptors[i].string_value());
|
|
- }
|
|
return str;
|
|
}
|
|
|
|
--
|
|
GitLab
|
|
|
|
|
|
From 349ca009f042fe0271b195bbc8892fcd8527048c Mon Sep 17 00:00:00 2001
|
|
From: OPNA2608 <opna2608@protonmail.com>
|
|
Date: Fri, 12 Sep 2025 18:45:21 +0200
|
|
Subject: [PATCH 3/3] mirsurface: add `mirror_mode_set_to`
|
|
|
|
---
|
|
src/modules/QtMir/Application/mirsurface.cpp | 4 ++++
|
|
1 file changed, 4 insertions(+)
|
|
|
|
diff --git a/src/modules/QtMir/Application/mirsurface.cpp b/src/modules/QtMir/Application/mirsurface.cpp
|
|
index b37bae31..6af36719 100644
|
|
--- a/src/modules/QtMir/Application/mirsurface.cpp
|
|
+++ b/src/modules/QtMir/Application/mirsurface.cpp
|
|
@@ -135,6 +135,10 @@ public:
|
|
void application_id_set_to(mir::scene::Surface const* /* surf */, std::string const& /* application_id */) override {};
|
|
#endif
|
|
|
|
+#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(2, 22, 0)
|
|
+ void mirror_mode_set_to(mir::scene::Surface const* /* surf */, MirMirrorMode /* mirror_mode */) override {};
|
|
+#endif
|
|
+
|
|
#else
|
|
void attrib_changed(MirWindowAttrib, int) override;
|
|
void resized_to(mir::geometry::Size const&) override;
|
|
--
|
|
GitLab
|
|
|