[vlc-devel] [PATCH v2 03/12] qml: use the top window to filter global key events rather than the embed widget
Pierre Lamot
pierre at videolabs.io
Thu May 14 14:05:22 CEST 2020
---
modules/gui/qt/maininterface/main_interface.cpp | 2 +-
modules/gui/qt/player/qml/Player.qml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/gui/qt/maininterface/main_interface.cpp b/modules/gui/qt/maininterface/main_interface.cpp
index 5a830c6e7e..50fc7b963e 100644
--- a/modules/gui/qt/maininterface/main_interface.cpp
+++ b/modules/gui/qt/maininterface/main_interface.cpp
@@ -419,7 +419,7 @@ void MainInterface::createMainWidget( QSettings * )
rootCtx->setContextProperty( "player", p_intf->p_sys->p_mainPlayerController );
rootCtx->setContextProperty( "i18n", i18n );
rootCtx->setContextProperty( "mainctx", mainCtx);
- rootCtx->setContextProperty( "rootQMLView", mediacenterView);
+ rootCtx->setContextProperty( "topWindow", this->windowHandle());
rootCtx->setContextProperty( "mainInterface", this);
rootCtx->setContextProperty( "dialogProvider", DialogsProvider::getInstance());
rootCtx->setContextProperty( "recentsMedias", new VLCRecentMediaModel( p_intf, this ));
diff --git a/modules/gui/qt/player/qml/Player.qml b/modules/gui/qt/player/qml/Player.qml
index 6e094a1f60..c6cead1215 100644
--- a/modules/gui/qt/player/qml/Player.qml
+++ b/modules/gui/qt/player/qml/Player.qml
@@ -422,7 +422,7 @@ Widgets.NavigableFocusScope {
//visible when user navigates within the control bar
EventFilter {
id: filter
- source: rootQMLView
+ source: topWindow
filterEnabled: controlBarView.state === "visible"
&& (controlBarView.focus || topcontrolView.focus)
Keys.onPressed: toolbarAutoHide.setVisible(5000)
--
2.25.1
More information about the vlc-devel
mailing list