diff --git a/src/Charts/LTMWindow.cpp b/src/Charts/LTMWindow.cpp index 47bd925796..7d128ed886 100644 --- a/src/Charts/LTMWindow.cpp +++ b/src/Charts/LTMWindow.cpp @@ -144,6 +144,10 @@ LTMWindow::LTMWindow(Context *context) : QFont defaultFont; // mainwindow sets up the defaults.. we need to apply #ifdef NOWEBKIT dataSummary = new QWebEngineView(this); +#if QT_VERSION >= 0x050800 + // stop stealing focus! + dataSummary->settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, false); +#endif //XXXdataSummary->setEnabled(false); // stop grabbing focus if (dpiXFactor > 1) { // 80 lines per page on hidpi screens (?) diff --git a/src/Charts/RideMapWindow.cpp b/src/Charts/RideMapWindow.cpp index e62bff560f..882d76035d 100644 --- a/src/Charts/RideMapWindow.cpp +++ b/src/Charts/RideMapWindow.cpp @@ -37,6 +37,8 @@ #ifdef NOWEBKIT #include +#include +#include #endif // overlay helper @@ -121,6 +123,10 @@ RideMapWindow::RideMapWindow(Context *context, int mapType) : GcChartWindow(cont #ifdef NOWEBKIT view = new QWebEngineView(this); +#if QT_VERSION >= 0x050800 + // stop stealing focus! + view->settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, false); +#endif #else view = new QWebView(); #endif diff --git a/src/Charts/RideSummaryWindow.cpp b/src/Charts/RideSummaryWindow.cpp index deda04fbdb..64482cc6c3 100644 --- a/src/Charts/RideSummaryWindow.cpp +++ b/src/Charts/RideSummaryWindow.cpp @@ -91,12 +91,15 @@ RideSummaryWindow::RideSummaryWindow(Context *context, bool ridesummary) : vlayout->setSpacing(0); vlayout->setContentsMargins(10,10,10,10); - #ifdef NOWEBKIT +#ifdef NOWEBKIT rideSummary = new QWebEngineView(this); - //XXX steals focus rideSummary->setEnabled(false); - #else +#if QT_VERSION >= 0x050800 + // stop stealing focus! + rideSummary->settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, false); +#endif +#else rideSummary = new QWebView(this); - #endif +#endif rideSummary->setContentsMargins(0,0,0,0); rideSummary->page()->view()->setContentsMargins(0,0,0,0);