Add calibrating banner
This commit is contained in:
parent
4682153ed3
commit
f01c635138
|
|
@ -6,4 +6,6 @@ out/
|
|||
*.po~
|
||||
kwin/src/xrdriveripc/xrdriveripc.py
|
||||
kwin/VERSION
|
||||
kwin/build-test/
|
||||
kwin/build-test/
|
||||
kwin/src/qml/calibrating.png
|
||||
kwin/src/qml/custom_banner.png
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ fi
|
|||
# this file is in .gitignore so it doesn't get duplicated
|
||||
cp ui/modules/PyXRLinuxDriverIPC/xrdriveripc.py $KWIN_DIR/src/xrdriveripc/xrdriveripc.py
|
||||
cp VERSION $KWIN_DIR
|
||||
cp modules/sombrero/*.png $KWIN_DIR/src/qml
|
||||
|
||||
pushd $KWIN_DIR > /dev/null
|
||||
if [ -z "${LOCAL_BUILD_SYSTEM+x}" ]; then
|
||||
|
|
|
|||
|
|
@ -67,6 +67,4 @@ target_link_libraries(breezy_desktop
|
|||
)
|
||||
|
||||
|
||||
install(DIRECTORY qml DESTINATION ${KDE_INSTALL_DATADIR}/kwin/effects/breezy_desktop)
|
||||
install(FILES qml/cursorOverlay.frag DESTINATION ${KDE_INSTALL_DATADIR}/kwin/effects/breezy_desktop/qml)
|
||||
install(FILES qml/cursorOverlay.vert DESTINATION ${KDE_INSTALL_DATADIR}/kwin/effects/breezy_desktop/qml)
|
||||
install(DIRECTORY qml DESTINATION ${KDE_INSTALL_DATADIR}/kwin/effects/breezy_desktop)
|
||||
|
|
@ -509,7 +509,11 @@ void BreezyDesktopEffect::updateImuRotation() {
|
|||
|
||||
float imuData[4 * DataView::IMU_QUAT_ENTRIES]; // 4 quaternion-sized rows
|
||||
memcpy(imuData, data + DataView::IMU_QUAT_DATA[DataView::OFFSET_INDEX], sizeof(imuData));
|
||||
bool wasImuResetState = m_imuResetState;
|
||||
m_imuResetState = (imuData[0] == 0.0f && imuData[1] == 0.0f && imuData[2] == 0.0f && imuData[3] == 1.0f);
|
||||
if (m_imuResetState != wasImuResetState) {
|
||||
Q_EMIT imuResetStateChanged();
|
||||
}
|
||||
|
||||
// convert NWU to EUS by passing root.rotation values: -y, z, -x
|
||||
QQuaternion quatT0(imuData[3], -imuData[1], imuData[2], -imuData[0]);
|
||||
|
|
@ -532,7 +536,6 @@ void BreezyDesktopEffect::updateImuRotation() {
|
|||
m_imuTimeElapsedMs = static_cast<quint32>(imuData[imuDataOffset + 0] - imuData[imuDataOffset + 1]);
|
||||
|
||||
m_imuTimestamp = imuDateMs;
|
||||
Q_EMIT imuRotationsChanged();
|
||||
}
|
||||
|
||||
QString BreezyDesktopEffect::cursorImageSource() const
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace KWin
|
|||
Q_OBJECT
|
||||
Q_PROPERTY(bool isEnabled READ isEnabled NOTIFY enabledStateChanged)
|
||||
Q_PROPERTY(bool zoomOnFocusEnabled READ isZoomOnFocusEnabled WRITE setZoomOnFocusEnabled NOTIFY zoomOnFocusChanged)
|
||||
Q_PROPERTY(bool imuResetState READ imuResetState)
|
||||
Q_PROPERTY(bool imuResetState READ imuResetState NOTIFY imuResetStateChanged)
|
||||
Q_PROPERTY(QList<QQuaternion> imuRotations READ imuRotations)
|
||||
Q_PROPERTY(quint32 imuTimeElapsedMs READ imuTimeElapsedMs)
|
||||
Q_PROPERTY(quint64 imuTimestamp READ imuTimestamp)
|
||||
|
|
@ -92,7 +92,7 @@ namespace KWin
|
|||
void displayWrappingSchemeChanged();
|
||||
void enabledStateChanged();
|
||||
void zoomOnFocusChanged();
|
||||
void imuRotationsChanged();
|
||||
void imuResetStateChanged();
|
||||
void cursorImageSourceChanged();
|
||||
void cursorPosChanged();
|
||||
void devicePropertiesChanged();
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ import QtQuick
|
|||
Item {
|
||||
id: singleDesktopView
|
||||
property point cursorPos: effect.cursorPos
|
||||
property bool supportsXR: false
|
||||
property bool showCalibratingBanner: false
|
||||
|
||||
function cursorInBounds() {
|
||||
const x = cursorPos.x
|
||||
|
|
@ -15,6 +17,7 @@ Item {
|
|||
}
|
||||
|
||||
DesktopView {
|
||||
id: desktopViewComponent
|
||||
screen: targetScreen
|
||||
width: targetScreen.geometry.width
|
||||
height: targetScreen.geometry.height
|
||||
|
|
@ -27,6 +30,13 @@ Item {
|
|||
z: 9999 // ensure on top
|
||||
}
|
||||
|
||||
Image {
|
||||
source: effect.customBannerEnabled ? "custom_banner.png" : "calibrating.png"
|
||||
visible: supportsXR && showCalibratingBanner
|
||||
anchors.horizontalCenter: desktopViewComponent.horizontalCenter
|
||||
anchors.bottom: desktopViewComponent.bottom
|
||||
}
|
||||
|
||||
onCursorPosChanged: {
|
||||
if (singleDesktopView.cursorInBounds()) {
|
||||
const newX = effect.cursorPos.x - targetScreen.geometry.x
|
||||
|
|
|
|||
|
|
@ -87,9 +87,16 @@ Item {
|
|||
return displays.monitorsToPlacements(fovDetails, adjustedGeometries, effect.displaySpacing);
|
||||
}
|
||||
|
||||
property bool targetScreenSupported: supportedModels.some(model => root.targetScreen.model.endsWith(model))
|
||||
property bool imuResetState: effect.imuResetState
|
||||
property bool isEnabled: effect.isEnabled
|
||||
|
||||
Component {
|
||||
id: desktopViewComponent
|
||||
SingleDesktopView {}
|
||||
SingleDesktopView {
|
||||
supportsXR: targetScreenSupported
|
||||
showCalibratingBanner: isEnabled && imuResetState
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
|
|
@ -121,9 +128,21 @@ Item {
|
|||
id: viewLoader
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
function checkLoadedComponent() {
|
||||
const show3DView = targetScreenSupported && isEnabled && !imuResetState;
|
||||
viewLoader.sourceComponent = show3DView ? view3DComponent : desktopViewComponent;
|
||||
}
|
||||
|
||||
onImuResetStateChanged: {
|
||||
checkLoadedComponent();
|
||||
}
|
||||
|
||||
onIsEnabledChanged: {
|
||||
checkLoadedComponent();
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
const targetScreenSupported = supportedModels.some(model => root.targetScreen.model.endsWith(model));
|
||||
viewLoader.sourceComponent = targetScreenSupported ? view3DComponent : desktopViewComponent;
|
||||
checkLoadedComponent();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue