From c721e00bc3c36317ed50824ca26665d4954863a3 Mon Sep 17 00:00:00 2001 From: Vitor Mateus De Almeida Date: Wed, 17 Jun 2020 11:53:13 -0300 Subject: [PATCH] Fix webcams area auto adjust when minimize presentation --- .../imports/ui/components/layout/layout-manager.jsx | 4 ++++ bigbluebutton-html5/imports/ui/components/media/service.js | 1 + .../imports/ui/components/presentation/component.jsx | 4 +--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/layout/layout-manager.jsx b/bigbluebutton-html5/imports/ui/components/layout/layout-manager.jsx index 694cc489b7..bce9a01f2b 100644 --- a/bigbluebutton-html5/imports/ui/components/layout/layout-manager.jsx +++ b/bigbluebutton-html5/imports/ui/components/layout/layout-manager.jsx @@ -87,6 +87,10 @@ class LayoutManager extends Component { window.addEventListener('slideChanged', () => { setTimeout(() => this.setLayoutSizes(), 200); }); + + window.addEventListener('togglePresentationHide', () => { + setTimeout(() => this.setLayoutSizes(), 200); + }); } componentDidUpdate(prevProps) { diff --git a/bigbluebutton-html5/imports/ui/components/media/service.js b/bigbluebutton-html5/imports/ui/components/media/service.js index 9811280c05..d8d1906839 100755 --- a/bigbluebutton-html5/imports/ui/components/media/service.js +++ b/bigbluebutton-html5/imports/ui/components/media/service.js @@ -53,6 +53,7 @@ const setSwapLayout = () => { }; const toggleSwapLayout = () => { + window.dispatchEvent(new Event('togglePresentationHide')); swapLayout.value = !swapLayout.value; swapLayout.tracker.changed(); }; diff --git a/bigbluebutton-html5/imports/ui/components/presentation/component.jsx b/bigbluebutton-html5/imports/ui/components/presentation/component.jsx index 146c1d9c4a..fa2ada7169 100755 --- a/bigbluebutton-html5/imports/ui/components/presentation/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/presentation/component.jsx @@ -120,11 +120,9 @@ class PresentationArea extends PureComponent { layoutContextState, } = this.props; - const { presentationAreaWidth, presentationAreaHeight } = this.state; - const { presentationAreaSize, numUsersVideo } = layoutContextState; + const { numUsersVideo } = layoutContextState; const { layoutContextState: prevLayoutContextState } = prevProps; const { - presentationAreaSize: prevPresentationAreaSize, numUsersVideo: prevNumUsersVideo, } = prevLayoutContextState;