=== added file 'demos/qml-demo-client/main.cpp'
I don't understand what this is useful for. Isn't the "qml" binary sufficient?
=== added file 'demos/qml-demo-shell/main.cpp'
same here.
=== added file 'src/common/utils.h'
file name "utils" as vague as possible:) Can you be more specific?
+++ src/common/utils.cpp
+qint64 resetStartTime(qint64 timestamp) {
+qint64 getStartTime_nsec(qint64 timestamp) {
please stick into an anonymous namespace
The indenting is inconsistent in the whole file.
+ QCoreApplication::instance()->setProperty("appStartTime", timestamp);
I suspect a static variable would do the job just as well.
+ qint64 startTime = getStartTime_nsec(timestamp.count())/1000000;
std::chrono has nanosecond to milisecond conversion abilities built in, I think you can just cast and it works. It would be safer than dividing by 1000000. I suspect you can avoid all usages of qint64 as a result.
====
This compression is a clever idea to work around the difference in timestamp units Qt & Mir uses. I'm still curious if instead of tying ourselves to the event APIs Qt has, e.g.
If we subclassed QWindowSystemInterfacePrivate::MouseEvent, and added the timestamp type we want, that event might pass through Qt safely. This would be especially usesful for Mir events which have more detail that Qt events have.
To be investigated. For now, your approach is good.
====
std::chrono::milliseconds compressTimestamp(std::chrono::nanoseconds timestamp);
Do you need the milliseconds anywhere, as I only see you calling .count() on this everywhere it's used. Why not just return ulong?
Also, would be good to document *why* you've done the timestamp compression/decompression, for future souls.
=== modified file 'src/platforms/mirserver/tracepoints.tp'
Typos:
touchEventDisptach_start
touchEventDisptach_end
and these propagate throughout the whole of mirserver.
=== modified file 'debian/rules'
-DNO_TESTS=1 - please undo, we want tests!
=== added file 'demos/ qml-demo- client/ main.cpp'
I don't understand what this is useful for. Isn't the "qml" binary sufficient?
=== added file 'demos/ qml-demo- shell/main. cpp'
same here.
=== added file 'src/common/ utils.h'
file name "utils" as vague as possible:) Can you be more specific?
+++ src/common/ utils.cpp qint64 timestamp) { nsec(qint64 timestamp) {
+qint64 resetStartTime(
+qint64 getStartTime_
please stick into an anonymous namespace
The indenting is inconsistent in the whole file.
+ QCoreApplicatio n::instance( )->setProperty( "appStartTime" , timestamp);
I suspect a static variable would do the job just as well.
+ qint64 startTime = getStartTime_ nsec(timestamp. count() )/1000000;
std::chrono has nanosecond to milisecond conversion abilities built in, I think you can just cast and it works. It would be safer than dividing by 1000000. I suspect you can avoid all usages of qint64 as a result.
====
This compression is a clever idea to work around the difference in timestamp units Qt & Mir uses. I'm still curious if instead of tying ourselves to the event APIs Qt has, e.g.
void QWindowSystemIn terface: :handleFrameStr utMouseEvent( QWindow *w, :MouseButtons b, Qt::KeyboardMod ifiers mods, :MouseEventSour ce source)
ulong timestamp, const QPointF & local, const QPointF & global,
Qt:
Qt:
we could make our own handle*Event() methods. In the end, the above method simply does:
QWindowSystemIn terfacePrivate: :MouseEvent * e = terfacePrivate: :MouseEvent( w, timestamp,
QWindowSystemI nterfacePrivate ::FrameStrutMou se,
QHighDpi: :fromNativeLoca lPosition( local, w),
QHighDpi: :fromNativePixe ls(global, w), b, mods, source);
new QWindowSystemIn
QWindowSystemIn terfacePrivate: :handleWindowSy stemEvent( e);
If we subclassed QWindowSystemIn terfacePrivate: :MouseEvent, and added the timestamp type we want, that event might pass through Qt safely. This would be especially usesful for Mir events which have more detail that Qt events have.
To be investigated. For now, your approach is good.
====
std::chrono: :milliseconds compressTimesta mp(std: :chrono: :nanoseconds timestamp);
Do you need the milliseconds anywhere, as I only see you calling .count() on this everywhere it's used. Why not just return ulong?
Also, would be good to document *why* you've done the timestamp compression/ decompression, for future souls.
=== modified file 'src/platforms/ mirserver/ tracepoints. tp' ach_start ach_end
Typos:
touchEventDispt
touchEventDispt
and these propagate throughout the whole of mirserver.