diff options
author | Daniel Lohmann <LibreOfficeContribution@dldld.de> | 2022-11-14 19:17:14 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2022-11-17 06:57:40 +0100 |
commit | a15bcda0e21be04bec424172192f2416b7f52422 (patch) | |
tree | 617b015a48b84f26c57abac6e34135532206b15f /sdext | |
parent | ef0858071faf93ce48237ea3948f50e288eb702b (diff) |
tdf#33495: Allow presenter console in windowed mode
Added an option in the Impress settings window to set the presenter
console into fullscreen/windowed mode. This will then be used the
next time a presentation is started.
Two pictures of how the result looks are given in the bug tracker.
Change-Id: I231f9180301301a9eccf9984ea4dcd529bd7dfce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142359
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/source/presenter/PresenterScreen.cxx | 26 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterScreen.hxx | 6 |
2 files changed, 28 insertions, 4 deletions
diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx index 993f9677803d..c4f2cda50f3e 100644 --- a/sdext/source/presenter/PresenterScreen.cxx +++ b/sdext/source/presenter/PresenterScreen.cxx @@ -261,6 +261,19 @@ bool PresenterScreen::isPresenterScreenEnabled(const css::uno::Reference<css::un >>= dEnablePresenterScreen; return dEnablePresenterScreen; } + +bool PresenterScreen::isPresenterScreenFullScreen(const css::uno::Reference<css::uno::XComponentContext>& rxContext) +{ + bool dPresenterScreenFullScreen = true; + PresenterConfigurationAccess aConfiguration ( + rxContext, + "/org.openoffice.Office.Impress/", + PresenterConfigurationAccess::READ_ONLY); + aConfiguration.GetConfigurationNode("Misc/Start/PresenterScreenFullScreen") + >>= dPresenterScreenFullScreen; + return dPresenterScreenFullScreen; +} + void SAL_CALL PresenterScreen::disposing() { Reference<XConfigurationController> xCC (mxConfigurationControllerWeak); @@ -324,7 +337,7 @@ void PresenterScreen::InitializePresenterScreen() mxConfigurationControllerWeak = xCC; Reference<drawing::framework::XResourceId> xMainPaneId( - GetMainPaneId(xPresentation)); + GetMainPaneId(xPresentation, xContext)); // An empty reference means that the presenter screen can // not or must not be displayed. if ( ! xMainPaneId.is()) @@ -506,7 +519,8 @@ sal_Int32 PresenterScreen::GetPresenterScreenFromScreen( sal_Int32 nPresentation } Reference<drawing::framework::XResourceId> PresenterScreen::GetMainPaneId ( - const Reference<presentation::XPresentation2>& rxPresentation) const + const Reference<presentation::XPresentation2>& rxPresentation, + const Reference<XComponentContext>& xContext) const { // A negative value means that the presentation spans all available // displays. That leaves no room for the presenter. @@ -514,10 +528,16 @@ Reference<drawing::framework::XResourceId> PresenterScreen::GetMainPaneId ( if (nScreen < 0) return nullptr; + auto fullScreenStr = isPresenterScreenFullScreen(xContext) + ? OUString("true") + : OUString("false"); + return ResourceId::create( Reference<XComponentContext>(mxContextWeak), PresenterHelper::msFullScreenPaneURL - + "?FullScreen=true&ScreenNumber=" + + "?FullScreen=" + + fullScreenStr + + "&ScreenNumber=" + OUString::number(nScreen)); } diff --git a/sdext/source/presenter/PresenterScreen.hxx b/sdext/source/presenter/PresenterScreen.hxx index 90d23ad4b7bd..3e4caf19442a 100644 --- a/sdext/source/presenter/PresenterScreen.hxx +++ b/sdext/source/presenter/PresenterScreen.hxx @@ -104,6 +104,9 @@ public: static bool isPresenterScreenEnabled( const css::uno::Reference<css::uno::XComponentContext>& rxContext); + static bool isPresenterScreenFullScreen( + const css::uno::Reference<css::uno::XComponentContext>& rxContext); + /** Make the presenter screen visible. */ void InitializePresenterScreen(); @@ -217,7 +220,8 @@ private: is displayed on another screen than the full screen presentation. */ css::uno::Reference<css::drawing::framework::XResourceId> GetMainPaneId ( - const css::uno::Reference<css::presentation::XPresentation2>& rxPresentation) const; + const css::uno::Reference<css::presentation::XPresentation2>& rxPresentation, + const css::uno::Reference<com::sun::star::uno::XComponentContext>& xContext) const; }; } |