ubports / qtmir Goto Github PK
View Code? Open in Web Editor NEWMoved to https://gitlab.com/ubports/core/qtmir/
Home Page: https://gitlab.com/ubports/core/qtmir/
Moved to https://gitlab.com/ubports/core/qtmir/
Home Page: https://gitlab.com/ubports/core/qtmir/
This repo contains a QPA plugin to make Qt a Mir server. Handy way to grab dependencies is with: $ sudo mk-build-deps -ir debian/control To use, compile and install (building in a "build" subdir as an example): $ mkdir build $ cd build $ cmake -DCMAKE_INSTALL_PREFIX=/usr ../ $ make $ sudo make install To enable debug output, replace the single "cmake" command with $ cmake -DCMAKE_BUILD_TYPE=Debug (is good to "make clean" beforehand) To avoid building the tests (to speed up the build): $ cmake -DNO_TESTS=true To enable logging of Qt's OpenGL debug messages: $ cmake -DQGL_DEBUG=true To test the server, enter the demos directory, and run (NB: server should be run as root): $ sudo su $ export QT_QPA_PLATFORM=mirserver $ export MIR_SERVER_FILE=/tmp/mir_socket $ unset QT_QPA_PLATFORMTHEME then run the Qt application of your choice (qmlscene best). As example, try $ qmlscene qml-demo-shell/qml-demo-shell.qml prepare the environment for running mir clients: $ sudo chmod a+rw /tmp/mir_socket $ export MIR_SOCKET=/tmp/mir_socket and then try running an application: $ mir_demo_client_egltriangle --desktop_file_hint=/usr/share/applications/gallery-app.desktop or $ unset QT_QPA_PLATFORMTHEME $ export QT_QPA_PLATFORM=ubuntumirclient $ qmlscene qml-demo-client/qml-demo-client.qml --desktop_file_hint=/usr/share/click/preinstalled/com.ubuntu.calendar/0.4.172/calendar-app.desktop where the desktop file hint specifies an existing file.
It appears that screenAdded and destroyAdded are no longer a thing
/tmp/qtmir/src/platforms/mirserver/mirserverintegration.cpp: In lambda function:
/tmp/qtmir/src/platforms/mirserver/mirserverintegration.cpp:160:15: error: ‘class MirServerIntegration’ has no member named ‘destroyScreen’
160 | this->destroyScreen(screen);
| ^~~~~~~~~~~~~
/tmp/qtmir/src/platforms/mirserver/mirserverintegration.cpp: In member function ‘virtual void MirServerIntegration::initialize()’:
/tmp/qtmir/src/platforms/mirserver/mirserverintegration.cpp:165:9: error: ‘screenAdded’ was not declared in this scope
165 | screenAdded(screen);
| ^~~~~~~~~~~
/src/platforms/mirserver/screen.cpp line 87:
case mir_pixel_format_xbgr_8888:
if (isLittleEndian()) {
// 0xRR,0xGG,0xBB,0xXX
return QImage::Format_RGBX8888;
} else {
// 0xXX,0xBB,0xGG,0xRR
qFatal("[mirserver QPA] "
"Qt doesn't support mir_pixel_format_xbgr_8888 in a big endian architecture");
}
break;
break; // <- unreachable
Was building bionic
branch on Arch GNU/Linux, faced this issue:
[ 42%] Building CXX object src/modules/Unity/Application/CMakeFiles/unityapplicationplugin.dir/upstart/taskcontroller.cpp.o
/mnt/antihype/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/src/modules/Unity/Application/upstart/taskcontroller.cpp: In function ‘std::shared_ptr<ubuntu::app_launch::Application> qtmir::upstart::{anonymous}::createApp(const QString&, std::shared_ptr<ubuntu::app_launch::Registry>)’:
/mnt/antihype/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/src/modules/Unity/Application/upstart/taskcontroller.cpp:81:33: error: catching polymorphic type ‘class std::runtime_error’ by value [-Werror=catch-value=]
} catch (std::runtime_error e) {
^
cc1plus: all warnings being treated as errors
make[2]: *** [src/modules/Unity/Application/CMakeFiles/unityapplicationplugin.dir/build.make:278: src/modules/Unity/Application/CMakeFiles/unityapplicationplugin.dir/upstart/taskcontroller.cpp.o] Error 1
Now fails to build on Arch GNU/Linux, bionic branch.
In file included from /home/vanyasem/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/tests/framework/mock_main_loop.h:21,
from /home/vanyasem/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/tests/framework/mock_main_loop.cpp:17:
/home/vanyasem/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/tests/framework/gmock_fixes.h: In instantiation of 'static testing::internal::ActionResultHolder<std::unique_ptr<_Tp> >* testing::internal::ActionResultHolder<std::unique_ptr<_Tp> >::PerformDefaultAction(const testing::internal::FunctionMockerBase<F>*, const typename testing::internal::Function<F>::ArgumentTuple&, const string&) [with F = std::unique_ptr<mir::time::Alarm>(mir::LockableCallback*); T = mir::time::Alarm; typename testing::internal::Function<F>::ArgumentTuple = std::tuple<mir::LockableCallback*>; testing::internal::string = std::__cxx11::basic_string<char>]':
/usr/include/gmock/gmock-spec-builders.h:1542:46: required from 'testing::internal::UntypedActionResultHolderBase* testing::internal::FunctionMockerBase<F>::UntypedPerformDefaultAction(void*, const string&) const [with F = std::unique_ptr<mir::time::Alarm>(mir::LockableCallback*); std::__cxx11::string = std::__cxx11::basic_string<char>]'
/usr/include/gmock/gmock-spec-builders.h:1538:42: required from here
/home/vanyasem/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/tests/framework/gmock_fixes.h:81:12: error: cannot bind rvalue reference of type 'testing::internal::RvalueRef<std::tuple<mir::LockableCallback*> >::type' {aka 'std::tuple<mir::LockableCallback*>&&'} to lvalue of type 'const ArgumentTuple' {aka 'const std::tuple<mir::LockableCallback*>'}
return new ActionResultHolder(
^~~~~~~~~~~~~~~~~~~~~~~
func_mocker->PerformDefaultAction(args, call_description));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gmock/gmock-generated-function-mockers.h:44,
from /usr/include/gmock/gmock.h:62,
from /home/vanyasem/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/tests/framework/gmock_fixes.h:39,
from /home/vanyasem/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/tests/framework/mock_main_loop.h:21,
from /home/vanyasem/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/tests/framework/mock_main_loop.cpp:17:
/usr/include/gmock/gmock-spec-builders.h:1511:10: note: initializing argument 1 of 'testing::internal::FunctionMockerBase<F>::Result testing::internal::FunctionMockerBase<F>::PerformDefaultAction(typename testing::internal::RvalueRef<typename testing::internal::Function<F>::ArgumentTuple>::type, const string&) const [with F = std::unique_ptr<mir::time::Alarm>(mir::LockableCallback*); testing::internal::FunctionMockerBase<F>::Result = std::unique_ptr<mir::time::Alarm>; typename testing::internal::RvalueRef<typename testing::internal::Function<F>::ArgumentTuple>::type = std::tuple<mir::LockableCallback*>&&; std::__cxx11::string = std::__cxx11::basic_string<char>]'
Result PerformDefaultAction(
^~~~~~~~~~~~~~~~~~~~
In file included from /home/vanyasem/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/tests/framework/mock_main_loop.h:21,
from /home/vanyasem/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/tests/framework/mock_main_loop.cpp:17:
/home/vanyasem/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/tests/framework/gmock_fixes.h: In instantiation of 'static testing::internal::ActionResultHolder<std::unique_ptr<_Tp> >* testing::internal::ActionResultHolder<std::unique_ptr<_Tp> >::PerformDefaultAction(const testing::internal::FunctionMockerBase<F>*, const typename testing::internal::Function<F>::ArgumentTuple&, const string&) [with F = std::unique_ptr<mir::time::Alarm>(const std::function<void()>&); T = mir::time::Alarm; typename testing::internal::Function<F>::ArgumentTuple = std::tuple<const std::function<void()>&>; testing::internal::string = std::__cxx11::basic_string<char>]':
/usr/include/gmock/gmock-spec-builders.h:1542:46: required from 'testing::internal::UntypedActionResultHolderBase* testing::internal::FunctionMockerBase<F>::UntypedPerformDefaultAction(void*, const string&) const [with F = std::unique_ptr<mir::time::Alarm>(const std::function<void()>&); std::__cxx11::string = std::__cxx11::basic_string<char>]'
/usr/include/gmock/gmock-spec-builders.h:1538:42: required from here
/home/vanyasem/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/tests/framework/gmock_fixes.h:81:12: error: cannot bind rvalue reference of type 'testing::internal::RvalueRef<std::tuple<const std::function<void()>&> >::type' {aka 'std::tuple<const std::function<void()>&>&&'} to lvalue of type 'const ArgumentTuple' {aka 'const std::tuple<const std::function<void()>&>'}
return new ActionResultHolder(
^~~~~~~~~~~~~~~~~~~~~~~
func_mocker->PerformDefaultAction(args, call_description));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gmock/gmock-generated-function-mockers.h:44,
from /usr/include/gmock/gmock.h:62,
from /home/vanyasem/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/tests/framework/gmock_fixes.h:39,
from /home/vanyasem/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/tests/framework/mock_main_loop.h:21,
from /home/vanyasem/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/tests/framework/mock_main_loop.cpp:17:
/usr/include/gmock/gmock-spec-builders.h:1511:10: note: initializing argument 1 of 'testing::internal::FunctionMockerBase<F>::Result testing::internal::FunctionMockerBase<F>::PerformDefaultAction(typename testing::internal::RvalueRef<typename testing::internal::Function<F>::ArgumentTuple>::type, const string&) const [with F = std::unique_ptr<mir::time::Alarm>(const std::function<void()>&); testing::internal::FunctionMockerBase<F>::Result = std::unique_ptr<mir::time::Alarm>; typename testing::internal::RvalueRef<typename testing::internal::Function<F>::ArgumentTuple>::type = std::tuple<const std::function<void()>&>&&; std::__cxx11::string = std::__cxx11::basic_string<char>]'
Result PerformDefaultAction(
^~~~~~~~~~~~~~~~~~~~
Starting with Qt 5.14 qtmir doesn't compile anymore:
/home/pmos/build/src/qtmir-f1a612ce524c57f689b68c6f3b57fdfe8d169560/src/modules/Unity/Application/mirsurfaceitem.cpp: In member function 'virtual QSGNode* qtmir::MirSurfaceItem::updatePaintNode(QSGNode*, QQuickItem::UpdatePaintNodeData*)':
/home/pmos/build/src/qtmir-f1a612ce524c57f689b68c6f3b57fdfe8d169560/src/modules/Unity/Application/mirsurfaceitem.cpp:237:20: error: no matching function for call to 'QSGDefaultInternalImageNode::QSGDefaultInternalImageNode()'
237 | node = new QSGDefaultInternalImageNode;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/pmos/build/src/qtmir-f1a612ce524c57f689b68c6f3b57fdfe8d169560/src/modules/Unity/Application/mirsurfaceitem.cpp:35:
/usr/include/QtQuick/5.14.1/QtQuick/private/qsgdefaultinternalimagenode_p.h:78:5: note: candidate: 'QSGDefaultInternalImageNode::QSGDefaultInternalImageNode(QSGDefaultRenderContext*)'
78 | QSGDefaultInternalImageNode(QSGDefaultRenderContext *rc);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/QtQuick/5.14.1/QtQuick/private/qsgdefaultinternalimagenode_p.h:78:5: note: candidate expects 1 argument, 0 provided
make[2]: *** [src/modules/Unity/Application/CMakeFiles/unityapplicationplugin.dir/build.make:194: src/modules/Unity/Application/CMakeFiles/unityapplicationplugin.dir/mirsurfaceitem.cpp.o] Error 1
See qtdeclarative commit: qt/qtdeclarative@341ab77
Fixing this seems to be non-trivial, at least I haven't managed to do it yet.
Mouse hover does not work on UT on the Pi making selection difficult. It may (or may not) be caused by a "hack" to mirsurfaceitem.cpp disabling mouse hover.
Building bionic
branch on Arch GNU/Linux
[ 62%] Linking CXX executable QtEventFeederTest
/usr/bin/ld: ../../libGMock.a(gmock-all.cc.o): undefined reference to symbol 'pthread_key_delete@@GLIBC_2.2.5'
/usr/lib/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [tests/mirserver/QtEventFeeder/CMakeFiles/QtEventFeederTest.dir/build.make:132: tests/mirserver/QtEventFeeder/QtEventFeederTest] Error 1
-pthread
is missing in target_link_libraries
in tests/mirserver/QtEventFeeder/CMakeLists.txt
Same as ubports/url-dispatcher#4
/home/pmos/build/src/qtmir-f1a612ce524c57f689b68c6f3b57fdfe8d169560/src/platforms/mirserver/qteventfeeder.cpp: In member function 'virtual void {anonymous}::QtWindowSystem::handleMouseEvent(ulong, QPointF, QPointF, Qt::MouseButtons, Qt::KeyboardModifiers)':
/home/pmos/build/src/qtmir-f1a612ce524c57f689b68c6f3b57fdfe8d169560/src/platforms/mirserver/qteventfeeder.cpp:453:120: error: 'static void QWindowSystemInterface::handleMouseEvent(QWindow*, ulong, const QPointF&, const QPointF&, Qt::MouseButtons, Qt::KeyboardModifiers, Qt::MouseEventSource) [with Delivery = QWindowSystemInterface::DefaultDelivery; ulong = long unsigned int; Qt::MouseButtons = QFlags<Qt::MouseButton>; Qt::KeyboardModifiers = QFlags<Qt::KeyboardModifier>]' is deprecated [-Werror=deprecated-declarations]
453 | QWindowSystemInterface::handleMouseEvent(focusedWindow(), timestamp, absolute, absolute, buttons, modifiers);
| ^
In file included from /home/pmos/build/src/qtmir-f1a612ce524c57f689b68c6f3b57fdfe8d169560/src/platforms/mirserver/qteventfeeder.h:22,
from /home/pmos/build/src/qtmir-f1a612ce524c57f689b68c6f3b57fdfe8d169560/src/platforms/mirserver/qteventfeeder.cpp:17:
/usr/include/QtGui/5.14.1/QtGui/qpa/qwindowsysteminterface.h:85:31: note: declared here
85 | QT_DEPRECATED static void handleMouseEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
| ^~~~~~~~~~~~~~~~
/home/pmos/build/src/qtmir-f1a612ce524c57f689b68c6f3b57fdfe8d169560/src/platforms/mirserver/qteventfeeder.cpp:453:120: error: 'static void QWindowSystemInterface::handleMouseEvent(QWindow*, ulong, const QPointF&, const QPointF&, Qt::MouseButtons, Qt::KeyboardModifiers, Qt::MouseEventSource) [with Delivery = QWindowSystemInterface::DefaultDelivery; ulong = long unsigned int; Qt::MouseButtons = QFlags<Qt::MouseButton>; Qt::KeyboardModifiers = QFlags<Qt::KeyboardModifier>]' is deprecated [-Werror=deprecated-declarations]
453 | QWindowSystemInterface::handleMouseEvent(focusedWindow(), timestamp, absolute, absolute, buttons, modifiers);
| ^
In file included from /home/pmos/build/src/qtmir-f1a612ce524c57f689b68c6f3b57fdfe8d169560/src/platforms/mirserver/qteventfeeder.h:22,
from /home/pmos/build/src/qtmir-f1a612ce524c57f689b68c6f3b57fdfe8d169560/src/platforms/mirserver/qteventfeeder.cpp:17:
/usr/include/QtGui/5.14.1/QtGui/qpa/qwindowsysteminterface.h:85:31: note: declared here
85 | QT_DEPRECATED static void handleMouseEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
| ^~~~~~~~~~~~~~~~
I found this commit on Qt's gerrit, maybe it's useful: https://codereview.qt-project.org/c/qt/qtwayland/+/278369
This package fails to compile due to this bug: ubports/cmake-extras#2
Patching cmake-extras breaks the package and requires replacing GTEST_BOTH_LIBRARIES
with GMOCK_LIBRARIES
(or you need to remove it if it already links to GMOCK) in all affected CMakeLists.txt
Currently this project is unlicensed, please add one (or multiple) in the root of this project.
Refuses to launch on mir:mesa-x11 with the latest mir
Explanation: canonical/mir#120
I've just tried to build qtmir against the mir 0.30.0.1 packages in upstream bionic. The build fails with multiple compiler errors related to API compatibility.
As far as I can tell the failures are down to the following patch introduced into the xenial
branch and merged into bionic
: b092933
This introduces multiple #if
rules based on MIR_SERVER_VERSION
. These seem unnecessary (qtmir builds if I revert this patch, but not with it) as well as being confusing: the top-level #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 30, 0)
seems to contain other checks within it (such as #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 25, 0)
) which will automatically be true if the top-level #if
check is.
Absent a compelling reason I would suggest reverting the patch, as I believe it may block a solution to ubports/unity8#30.
mir api was updated but qtmir is not adapted to changes, so it doesn't build anymore https://paste.ubuntu.com/p/sKqm9SjhvY/
Some things make crossbuilder not working for QtMir. I got it working after changing:
sudo ln -s ../../../qt5/bin/moc /usr/lib/x86_64-linux-gnu/qt5/bin/moc
This package depends on glm (<glm/glm.hpp>
), and url-dispatcher (url-dispatcher.h
), but cmake
doesn't check for their existence (causing build-time errors if they are absent)
[ 16%] Building CXX object src/platforms/mirserver/CMakeFiles/qpa-mirserver-mirserver.dir/mirdisplayconfigurationpolicy.cpp.o
In file included from /mnt/antihype/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/src/platforms/mirserver/mirdisplayconfigurationpolicy.cpp:20:
/usr/include/mirplatform/mir/graphics/display_configuration.h:30:10: fatal error: glm/glm.hpp: No such file or directory
#include <glm/glm.hpp>
^~~~~~~~~~~~~
compilation terminated.
[ 5%] Building CXX object src/platforms/mirserver/CMakeFiles/qpa-mirserver-nomirserver.dir/services.cpp.o
/mnt/antihype/Projects/AUR/_Unity8/_Unity8-Arch/qtmir-git/src/qtmir/src/platforms/mirserver/services.cpp:22:10: fatal error: url-dispatcher.h: No such file or directory
#include <url-dispatcher.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.