diff options
-rw-r--r-- | src/corelib/events/mkeyboardstatetracker.cpp | 4 | ||||
-rw-r--r-- | src/corelib/widgets/mwindow.cpp | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/corelib/events/mkeyboardstatetracker.cpp b/src/corelib/events/mkeyboardstatetracker.cpp index 4cd784ab..7a8dd523 100644 --- a/src/corelib/events/mkeyboardstatetracker.cpp +++ b/src/corelib/events/mkeyboardstatetracker.cpp @@ -60,12 +60,16 @@ void MKeyboardStateTrackerPrivate::initContextSubscriber() void MKeyboardStateTrackerPrivate::subscribe() { +#ifdef HAVE_CONTEXTSUBSCRIBER keyboardOpenProperty.subscribe(); +#endif } void MKeyboardStateTrackerPrivate::unsubscribe() { +#ifdef HAVE_CONTEXTSUBSCRIBER keyboardOpenProperty.unsubscribe(); +#endif } MKeyboardStateTracker::MKeyboardStateTracker() : diff --git a/src/corelib/widgets/mwindow.cpp b/src/corelib/widgets/mwindow.cpp index a87ca7bc..22164b8c 100644 --- a/src/corelib/widgets/mwindow.cpp +++ b/src/corelib/widgets/mwindow.cpp @@ -605,9 +605,10 @@ void MWindowPrivate::ensureOrientationAngleIsUpToDateBeforeShowing() if (!q->isVisible() && !q->isOrientationAngleLocked() && MOrientationTracker::instance()->orientationAngle() != q->orientationAngle()) { +#ifdef HAVE_CONTEXTSUBSCRIBER // We are about to be shown but our orientation angle is outdated. - MOrientationTracker::instance()->d_ptr->subscribeToSensorProperies(); +#endif MOnDisplayChangeEvent ev(true, QRectF(QPointF(0, 0), q->visibleSceneSize())); MApplication::instance()->sendEvent(q, &ev); @@ -1269,9 +1270,11 @@ void MWindow::paintEvent(QPaintEvent *event) bool MWindow::event(QEvent *event) { Q_D(MWindow); +#ifdef HAVE_CONTEXTSUBSCRIBER if(event->type() == QEvent::Show) { MOrientationTracker::instance()->d_func()->waitForSensorPropertiesToSubscribe(); } +#endif if ((event->type() == QEvent::Show && !isMinimized()) || event->type() == QEvent::WindowActivate) { MComponentData::setActiveWindow(this); |