From bd4b95b0affd1aca876ca4693676349d1882c1ff Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Mon, 23 Mar 2015 22:28:28 +0000 Subject: [PATCH] - fix https://code.google.com/p/bigbluebutton/issues/detail?id=1849 --- .../modules/layout/managers/LayoutManager.as | 26 +++++++++++++------ .../modules/layout/model/LayoutDefinition.as | 14 +++++++--- .../modules/layout/model/WindowLayout.as | 14 ++++++---- 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/managers/LayoutManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/managers/LayoutManager.as index c3ef812a97..df2b4324eb 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/managers/LayoutManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/managers/LayoutManager.as @@ -89,13 +89,15 @@ package org.bigbluebutton.modules.layout.managers public function LayoutManager() { _applyCurrentLayoutTimer.addEventListener(TimerEvent.TIMER, function(e:TimerEvent):void { + trace(LOG + " timerEvent layout [" + _currentLayout.name + "]"); applyLayout(_currentLayout); trace(LOG + "Applied layout after user resized browser"); }); _sendCurrentLayoutUpdateTimer.addEventListener(TimerEvent.TIMER, function(e:TimerEvent):void { trace(LOG + "Applying layout due to window resize"); if (_autoSync) - sendLayoutUpdate(updateCurrentLayout()); + trace(LOG + "Applying layout on autoSync"); + sendLayoutUpdate(updateCurrentLayout(_currentLayout)); }); } @@ -162,6 +164,7 @@ package org.bigbluebutton.modules.layout.managers _canvas.windowManager.addEventListener(MDIManagerEvent.WINDOW_RESTORE, onActionOverWindowFinished); _canvas.windowManager.addEventListener(MDIManagerEvent.WINDOW_ADD, function(e:MDIManagerEvent):void { checkPermissionsOverWindow(e.window); + trace(LOG + " setCanvas layout [" + _currentLayout.name + "]"); applyLayout(_currentLayout); }); @@ -200,14 +203,14 @@ package org.bigbluebutton.modules.layout.managers defaultLayout = _layoutModel.getDefaultLayout(); } - trace("************** USING [" + defaultLayout.name + "] as default LAYOUT ***************************"); + trace(LOG + " Using [" + defaultLayout.name + "] as default LAYOUT."); applyLayout(defaultLayout); } private function dispatchSwitchedLayoutEvent(layoutID:String):void { if (_currentLayout != null && _currentLayout.name == layoutID) return; - trace("************** DISPATCHING [" + layoutID + "] as new LAYOUT ***************************"); + trace(LOG + " Dispatch [" + layoutID + "] as new LAYOUT"); var layoutEvent:SwitchedLayoutEvent = new SwitchedLayoutEvent(); layoutEvent.layoutID = layoutID; _globalDispatcher.dispatchEvent(layoutEvent); @@ -245,7 +248,7 @@ package org.bigbluebutton.modules.layout.managers layout.applyToCanvas(_canvas); dispatchSwitchedLayoutEvent(layout.name); } - + trace(LOG + " applyLayout layout [" + layout.name + "]"); updateCurrentLayout(layout); _detectContainerChange = true; } @@ -262,6 +265,7 @@ package org.bigbluebutton.modules.layout.managers public function applyRemoteLayout(e:LayoutFromRemoteEvent):void { var layout:LayoutDefinition = e.layout; + trace(LOG + " applyRemoteLayout layout [" + layout.name + "]"); applyLayout(layout); } @@ -317,7 +321,7 @@ package org.bigbluebutton.modules.layout.managers checkPermissionsOverWindow(e.window); trace(LOG + "Window is being resized. Event=[" + e.type + "]"); - updateCurrentLayout(); + updateCurrentLayout(_currentLayout); /* * some events related to animated actions must be delayed because if it's not, the * current layout doesn't get properly updated @@ -328,13 +332,16 @@ package org.bigbluebutton.modules.layout.managers } } - private function updateCurrentLayout(layout:LayoutDefinition=null):LayoutDefinition { + private function updateCurrentLayout(layout:LayoutDefinition):LayoutDefinition { + trace(LOG + "updateCurrentLayout"); if (layout != null) { if (_currentLayout) _currentLayout.currentLayout = false; _currentLayout = layout; + trace(LOG + "updateCurrentLayout - currentLayout = [" + layout.name + "]"); layout.currentLayout = true; } else { _currentLayout = LayoutDefinition.getLayout(_canvas, ResourceUtil.getInstance().getString('bbb.layout.combo.customName')); + trace(LOG + "updateCurrentLayout - layout is NULL! Setting currentLayout = [" + _currentLayout.name + "]"); } return _currentLayout; @@ -345,8 +352,11 @@ package org.bigbluebutton.modules.layout.managers * on the role of the participant */ public function presenterChanged():void { - if (_canvas != null) - applyLayout(_currentLayout); + if (_canvas != null) { + trace(LOG + " presenterChanged layout [" + _currentLayout.name + "]"); + applyLayout(_currentLayout); + } + } } } \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/model/LayoutDefinition.as b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/model/LayoutDefinition.as index 3e8c6ebeaa..96762c4021 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/model/LayoutDefinition.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/model/LayoutDefinition.as @@ -28,6 +28,8 @@ package org.bigbluebutton.modules.layout.model { import org.bigbluebutton.core.managers.UserManager; import org.bigbluebutton.modules.layout.managers.OrderManager; + private static const LOG:String = "Layout::LayoutDefinition - "; + [Bindable] public var name:String; // default is a reserved word in actionscript [Bindable] public var defaultLayout:Boolean = false; @@ -90,7 +92,7 @@ package org.bigbluebutton.modules.layout.model { return _layoutsPerRole[Role.PRESENTER]; } else { LogUtil.error("There's no layout that fits the participants profile"); - trace("LayoutDefinition::getMyLayout There's no layout that fits the participants profile"); + trace(LOG + "getMyLayout There's no layout that fits the participants profile"); return null; } } @@ -187,10 +189,14 @@ package org.bigbluebutton.modules.layout.model { var type:String; for each (var window:MDIWindow in windows) { - type = WindowLayout.getType(window); - - if (!ignoreWindowByType(type)) + type = WindowLayout.getType(window); + trace(LOG + "Determine if we need to apply layout [" + name + "] for window [" + type + "]"); + if (!ignoreWindowByType(type)) { + trace(LOG + "Applying layout [" + name + "] to window [" + type + "]"); WindowLayout.setLayout(canvas, window, transformedLayout[type]); + } else { + trace(LOG + "Ignoring layout [" + name + "] to window [" + type + "]"); + } } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/model/WindowLayout.as b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/model/WindowLayout.as index b3066ac8e9..d7f04637b1 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/model/WindowLayout.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/model/WindowLayout.as @@ -136,21 +136,25 @@ package org.bigbluebutton.modules.layout.model { layout.hidden = !window.visible; layout.order = OrderManager.getInstance().getOrderByRef(window); -// trace("WindowLayout::getLayout for " + layout.name + " [minimized=" + layout.minimized + ",maximized=" + layout.maximized + ",hidden=" + layout.hidden -// + ",drag=" + layout.draggable + ",resize=" + layout.resizable + "]"); + trace("WindowLayout::getLayout for " + layout.name + " [minimized=" + layout.minimized + ",maximized=" + layout.maximized + ",hidden=" + layout.hidden + + ",drag=" + layout.draggable + ",resize=" + layout.resizable + "]"); return layout; } static public function setLayout(canvas:MDICanvas, window:MDIWindow, layout:WindowLayout):void { -// trace("WindowLayout::setLayout for " + window.name + ",layout=" + layout.name + "]"); + if (window == null) trace("WindowLayout::setLayout - window is NULL!!!"); + if (layout == null) trace("WindowLayout::setLayout - layout is NULL!!!"); + if (layout.name == null) trace("WindowLayout::setLayout - layout.name is NULL!!!"); + + trace("WindowLayout::setLayout for " + getType(window) + ",layout=" + layout.name + "]"); if (layout == null) { return; } -// trace("WindowLayout::setLayout [minimized=" + layout.minimized + ",maximized=" + layout.maximized + ",hidden=" + layout.hidden -// + ",drag=" + layout.draggable + ",resize=" + layout.resizable + "]"); + trace("WindowLayout::setLayout [minimized=" + layout.minimized + ",maximized=" + layout.maximized + ",hidden=" + layout.hidden + + ",drag=" + layout.draggable + ",resize=" + layout.resizable + "]"); layout.applyToWindow(canvas, window); }