diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/events/LayoutEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/events/LayoutEvent.as
old mode 100755
new mode 100644
index 7f95201e26a76d2eb9331cab62eed675d4487b8b..f7442132cc1724bc80586189caa8c298b716c75d
--- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/events/LayoutEvent.as
+++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/events/LayoutEvent.as
@@ -22,7 +22,10 @@ package org.bigbluebutton.modules.layout.events
 
   public class LayoutEvent extends Event
   {
+    public static const SYNC_LAYOUT_EVENT:String = 'SYNC_LAYOUT_EVENT';
     public static const BROADCAST_LAYOUT_EVENT:String = 'BROADCAST_LAYOUT_EVENT';
+    public static const LOCK_LAYOUT_EVENT:String = 'LOCK_LAYOUT_EVENT';
+    public static const UNLOCK_LAYOUT_EVENT:String = 'UNLOCK_LAYOUT_EVENT';
     public static const STOP_LAYOUT_MODULE_EVENT:String = 'STOP_LAYOUT_MODULE_EVENT';
     public static const VIEW_INITIALIZED_EVENT:String = 'VIEW_INITIALIZED_EVENT';
 
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 bf902510746f2db914222f287ac210606a62b6ff..627920df63ef81253168cdd7228945c5f728c1fd 100755
--- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/managers/LayoutManager.as
+++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/managers/LayoutManager.as
@@ -71,6 +71,17 @@ package org.bigbluebutton.modules.layout.managers
     
     private var _layoutModel:LayoutModel = LayoutModel.getInstance();
     
+    /**
+    * If (sync) affects viewers only. 
+    */
+    private var _viewersOnly:Boolean = false;
+    
+    /**
+    * If we sync automatically with other users while the action (move, resize) is done on the
+    * window.
+    */
+    private var _autoSync:Boolean = false;
+    
 		private var _eventsToDelay:Array = new Array(MDIManagerEvent.WINDOW_RESTORE,
 				MDIManagerEvent.WINDOW_MINIMIZE,
 				MDIManagerEvent.WINDOW_MAXIMIZE);
@@ -78,13 +89,13 @@ 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");
+        trace(LOG + "Applied layout after user resized browser");
       });
       _sendCurrentLayoutUpdateTimer.addEventListener(TimerEvent.TIMER, function(e:TimerEvent):void {
-        //trace(LOG + "Applying layout due to window resize");
-        updateCurrentLayout(null);
+        trace(LOG + "Applying layout due to window resize");
+        if (_autoSync)
+          sendLayoutUpdate(updateCurrentLayout());
       });
     }
     
@@ -96,7 +107,7 @@ package org.bigbluebutton.modules.layout.managers
      *  the layouts to populate the list when both are created.
      */
 		public function loadServerLayouts(layoutUrl:String):void {
-			//trace(LOG + " loading server layouts from " + layoutUrl);
+			trace(LOG + " loading server layouts from " + layoutUrl);
 			var loader:LayoutLoader = new LayoutLoader();
 			loader.addEventListener(LayoutsLoadedEvent.LAYOUTS_LOADED_EVENT, function(e:LayoutsLoadedEvent):void {
 				if (e.success) {
@@ -105,7 +116,7 @@ package org.bigbluebutton.modules.layout.managers
           broadcastLayouts();
 					_serverLayoutsLoaded = true;
 
-					//trace(LOG + " layouts loaded successfully");
+					trace(LOG + " layouts loaded successfully");
 				} else {
 					trace(LOG + " layouts not loaded (" + e.error.message + ")");
 				}
@@ -168,7 +179,6 @@ 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);
 			});
 			
@@ -181,11 +191,11 @@ package org.bigbluebutton.modules.layout.managers
 		}
 
     public function switchToLayout(name:String):void {
-      //trace(LOG + " switching to layout [" + name + "] ");
+      trace(LOG + " switching to layout [" + name + "] ");
       var newLayout:LayoutDefinition = _layoutModel.getLayout(name);
       if (newLayout == null) return;
 
-      //trace(LOG + " applying layout [" + newLayout.name + "] to windows.");
+      trace(LOG + " applying layout [" + newLayout.name + "] to windows.");
       applyLayout(newLayout);     
     }
     
@@ -207,27 +217,33 @@ package org.bigbluebutton.modules.layout.managers
         defaultLayout = _layoutModel.getDefaultLayout();
       }
       
-      //trace(LOG + " Using [" + defaultLayout.name + "] as default LAYOUT.");
+      trace("************** USING [" + defaultLayout.name + "] as default LAYOUT ***************************");
 			applyLayout(defaultLayout);
 		}
 		
     private function dispatchSwitchedLayoutEvent(layoutID:String):void {
       if (_currentLayout != null && _currentLayout.name == layoutID) return;
       
-      //trace(LOG + " Dispatch [" + layoutID + "] as new LAYOUT");
+      trace("************** DISPATCHING [" + layoutID + "] as new LAYOUT ***************************");
       var layoutEvent:SwitchedLayoutEvent = new SwitchedLayoutEvent();
       layoutEvent.layoutID = layoutID;
       _globalDispatcher.dispatchEvent(layoutEvent);      
     }
+
+    public function syncLayout():void {
+      if (UsersUtil.amIModerator() || UsersUtil.amIPresenter()) {
+        _globalDispatcher.dispatchEvent(new SyncLayoutEvent(_currentLayout));
+      }
+    }
       
 		public function lockLayout():void {
 			_locked = true;
-			//trace(LOG + " layout locked by myself");
+			trace(LOG + " layout locked by myself");
 			sendLayoutUpdate(_currentLayout);
 		}
 		
 		public function broadcastLayout():void {
-			//trace(LOG + " layout changed by me. Sync others to this new layout.");
+			trace(LOG + " layout changed by me. Sync others to this new layout.");
 			var e:SyncLayoutEvent = new SyncLayoutEvent(_currentLayout);
 			_globalDispatcher.dispatchEvent(e);
 
@@ -236,7 +252,7 @@ package org.bigbluebutton.modules.layout.managers
 		
 		private function sendLayoutUpdate(layout:LayoutDefinition):void {
 			if (UsersUtil.amIModerator() || UsersUtil.amIPresenter()) {
-				//trace("LayoutManager: synching layout to remote users");
+				trace("LayoutManager: synching layout to remote users");
 				var e:SyncLayoutEvent = new SyncLayoutEvent(layout);
 				_globalDispatcher.dispatchEvent(e);
 			}
@@ -249,7 +265,7 @@ package org.bigbluebutton.modules.layout.managers
         dispatchSwitchedLayoutEvent(layout.name);
         UserManager.getInstance().getConference().numAdditionalSharedNotes = layout.numAdditionalSharedNotes;
       }
-      //trace(LOG + " applyLayout layout [" + layout.name +  "]");	
+				
 			updateCurrentLayout(layout);
 			_detectContainerChange = true;
 		}
@@ -266,24 +282,23 @@ 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);
 		}
 		
 		public function remoteLockLayout():void {
-			//trace(LOG + " remote lock received");
+			trace(LOG + " remote lock received");
 			_locked = true;
 			checkPermissionsOverWindow();
 		}
 		
     public function remoteSyncLayout(event:RemoteSyncLayoutEvent):void {
-      //trace(LOG + " remote lock received");
+      trace(LOG + " remote lock received");
       
       checkPermissionsOverWindow();
     }
     
 		public function remoteUnlockLayout():void {
-			//trace(LOG + " remote unlock received");
+			trace(LOG + " remote unlock received");
 			_locked = false;
 			checkPermissionsOverWindow();
 		}
@@ -305,7 +320,7 @@ package org.bigbluebutton.modules.layout.managers
 		}
 		
 		private function onContainerResized(e:ResizeEvent):void {
-      //trace(LOG + "Canvas is changing as user is resizing browser");
+      trace(LOG + "Canvas is changing as user is resizing browser");
       /*
       *	the main canvas has been resized
       *	while the user is resizing the window, this event is dispatched 
@@ -316,35 +331,43 @@ package org.bigbluebutton.modules.layout.managers
       _applyCurrentLayoutTimer.start();
 		}
 			
-    private function onActionOverWindowFinished(e:MDIManagerEvent):void {
+		private function onActionOverWindowFinished(e:MDIManagerEvent):void {
       if (LayoutDefinition.ignoreWindow(e.window))
         return;
       
       checkPermissionsOverWindow(e.window);
-      //trace(LOG + "Window is being resized. Event=[" + e.type + "]");
-      //updateCurrentLayout(null);
-      /*
-       * 	All events must be delayed because the window doesn't actually 
-	   *    change size until after the animation has finished.
-       */
-      _sendCurrentLayoutUpdateTimer.reset();
-      _sendCurrentLayoutUpdateTimer.start();
-    }
+      trace(LOG + "Window is being resized. Event=[" + e.type + "]");
+      updateCurrentLayout();
+        /*
+        * 	some events related to animated actions must be delayed because if it's not, the 
+        * 	current layout doesn't get properly updated
+        */
+        if (_eventsToDelay.indexOf(e.type) != -1) {
+          _sendCurrentLayoutUpdateTimer.reset();
+          _sendCurrentLayoutUpdateTimer.start();
+        } 
+		}
 		
-		private function updateCurrentLayout(layout:LayoutDefinition):LayoutDefinition {
-      //trace(LOG + "updateCurrentLayout");
+		private function updateCurrentLayout(layout:LayoutDefinition=null):LayoutDefinition {
       if (layout != null) {
         if (_currentLayout) _currentLayout.currentLayout = false;
         _currentLayout = layout;
-        //trace(LOG + "updateCurrentLayout - currentLayout = [" + layout.name + "]");
         layout.currentLayout = true;
       } else {
         _globalDispatcher.dispatchEvent(new LayoutEvent(LayoutEvent.INVALIDATE_LAYOUT_EVENT));
         _currentLayout = LayoutDefinition.getLayout(_canvas, ResourceUtil.getInstance().getString('bbb.layout.combo.customName'));
-        //trace(LOG + "updateCurrentLayout - layout is NULL! Setting currentLayout = [" + _currentLayout.name + "]");
       }
 
 			return _currentLayout;
 		}
+		
+		/*
+		 * this is because a unique layout may have multiple definitions depending
+		 * on the role of the participant
+		 */ 
+		public function presenterChanged():void {
+			if (_canvas != null)
+				applyLayout(_currentLayout);
+		}
 	}
 }
\ No newline at end of file
diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/maps/LayoutEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/maps/LayoutEventMap.mxml
old mode 100755
new mode 100644
index c36a54feff572f6e3d9a1638270eaf3eaa053b40..1f9fa777cc82cffddc2c09986fad8e75c8365e04
--- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/maps/LayoutEventMap.mxml
+++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/maps/LayoutEventMap.mxml
@@ -71,10 +71,18 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
     <EventHandlers type="{LayoutEvent.APPLY_DEFAULT_LAYOUT_EVENT}">
    		<MethodInvoker generator="{LayoutManager}" method="applyDefaultLayout" />
     </EventHandlers>
+    
+    <EventHandlers type="{LayoutEvent.LOCK_LAYOUT_EVENT}">
+      <MethodInvoker generator="{LayoutManager}" method="lockLayout" />
+    </EventHandlers>
 
   <EventHandlers type="{EventConstants.LOCK_LAYOUT_REQ}">
     <MethodInvoker generator="{LayoutManager}" method="lockLayout"/>
   </EventHandlers>
+  
+    <EventHandlers type="{LayoutEvent.UNLOCK_LAYOUT_EVENT}">
+   		<MethodInvoker generator="{LayoutService}" method="unlockLayout" />
+    </EventHandlers>
 
   <EventHandlers type="{EventConstants.UNLOCK_LAYOUT_REQ}">
     <MethodInvoker generator="{LayoutService}" method="unlockLayout"/>
@@ -100,6 +108,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
     <EventHandlers type="{LayoutFromRemoteEvent.LAYOUT_FROM_REMOTE}">
    		<MethodInvoker generator="{LayoutManager}" method="applyRemoteLayout" arguments="{event}" />
     </EventHandlers>
+
+  <EventHandlers type="{LayoutEvent.SYNC_LAYOUT_EVENT}">
+    <MethodInvoker generator="{LayoutManager}" method="syncLayout" />
+  </EventHandlers>
   
     <EventHandlers type="{LayoutEvent.SAVE_LAYOUTS_EVENT}">
    		<MethodInvoker generator="{LayoutManager}" method="saveLayoutsToFile" />
@@ -124,6 +136,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
   <EventHandlers type="{RemoteSyncLayoutEvent.REMOTE_SYNC_LAYOUT_EVENT}">
     <MethodInvoker generator="{LayoutManager}" method="remoteSyncLayout" arguments="{event}"/>
   </EventHandlers>
+  	
+    <EventHandlers type="{MadePresenterEvent.SWITCH_TO_VIEWER_MODE}">
+   		<MethodInvoker generator="{LayoutManager}" method="presenterChanged" />
+    </EventHandlers>
+
+    <EventHandlers type="{MadePresenterEvent.SWITCH_TO_PRESENTER_MODE}">
+   		<MethodInvoker generator="{LayoutManager}" method="presenterChanged" />
+    </EventHandlers>
 
   <Injectors target="{LayoutService}">
     <PropertyInjector targetKey="receiver" source="{MessageReceiver}"/>
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 d8e637016bf67ea3f2cb411aa0f567bb34a2960a..030748ebd5e72b8e5677e6fb29cd7606cf12c8a7 100755
--- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/model/LayoutDefinition.as
+++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/model/LayoutDefinition.as
@@ -16,23 +16,18 @@
 * with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 *
 */
-package org.bigbluebutton.modules.layout.model {
+package org.bigbluebutton.modules.layout.model {
 
 	public class LayoutDefinition {
 
 		import flash.utils.Dictionary;
-		import flash.utils.getQualifiedClassName;
-		
 		import flexlib.mdi.containers.MDICanvas;
-		import flexlib.mdi.containers.MDIWindow;
-		
+		import flexlib.mdi.containers.MDIWindow;		
 		import org.bigbluebutton.common.LogUtil;
 		import org.bigbluebutton.common.Role;
 		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;
@@ -95,7 +90,7 @@ package org.bigbluebutton.modules.layout.model {
 				return _layoutsPerRole[Role.PRESENTER];
 			} else {
 				LogUtil.error("There's no layout that fits the participants profile");
-        //trace(LOG + "getMyLayout There's no layout that fits the participants profile");
+        trace("LayoutDefinition::getMyLayout There's no layout that fits the participants profile");
 				return null;
 			}
 		}
@@ -129,9 +124,62 @@ package org.bigbluebutton.modules.layout.model {
 			return xml;
 		}
 		
+		/*
+		 * 0 if there's no order
+		 * 1 if "a" should appears after "b"
+		 * -1 if "a" should appears before "b"
+		 */
+		private function sortWindows(a:Object, b:Object):int {
+			// ignored windows are positioned in front
+			if (a.ignored && b.ignored) return 0;
+			if (a.ignored) return 1;
+			if (b.ignored) return -1;
+			// then comes the windows that has no layout definition
+			if (!a.hasLayoutDefinition && !b.hasLayoutDefinition) return 0;
+			if (!a.hasLayoutDefinition) return 1;
+			if (!b.hasLayoutDefinition) return -1;
+			// then the focus order is used to sort
+			if (a.order == b.order) return 0;
+			if (a.order == -1) return 1;
+			if (b.order == -1) return -1;
+			return (a.order < b.order? 1: -1);
+		}
+		
+		private function adjustWindowsOrder(canvas:MDICanvas):void {
+			var orderedList:Array = new Array();
+			var type:String;
+			var order:int;
+			var ignored:Boolean;
+			var hasLayoutDefinition:Boolean;
+			
+//			LogUtil.debug("=> Before sort");
+			for each (var window:MDIWindow in canvas.windowManager.windowList) {
+				type = WindowLayout.getType(window);
+				hasLayoutDefinition = myLayout.hasOwnProperty(type);
+				if (hasLayoutDefinition)
+					order = myLayout[type].order;
+				else
+					order = -1;
+				ignored = ignoreWindowByType(type);
+				var item:Object = { window:window, order:order, type:type, ignored:ignored, hasLayoutDefinition:hasLayoutDefinition };
+				orderedList.push(item);
+//				LogUtil.debug("===> type: " + item.type + " ignored? " + item.ignored + " hasLayoutDefinition? " + item.hasLayoutDefinition + " order? " + item.order);
+			}
+			orderedList.sort(this.sortWindows);
+//			LogUtil.debug("=> After sort");
+			for each (var obj:Object in orderedList) {
+//				LogUtil.debug("===> type: " + obj.type + " ignored? " + obj.ignored + " hasLayoutDefinition? " + obj.hasLayoutDefinition + " order? " + obj.order);
+				if (!obj.ignored)
+					OrderManager.getInstance().bringToFront(obj.window);
+				canvas.windowManager.bringToFront(obj.window);
+			}
+		}
+		
 		public function applyToCanvas(canvas:MDICanvas):void {
 			if (canvas == null)
 				return;
+
+			adjustWindowsOrder(canvas);
 			
 			var windows:Array = canvas.windowManager.windowList;
 			// LogUtil.traceObject(myLayout);
@@ -139,14 +187,10 @@ package org.bigbluebutton.modules.layout.model {
 			
 			var type:String;
 			for each (var window:MDIWindow in windows) {
-				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 + "]");
+					type = WindowLayout.getType(window);
+	
+				if (!ignoreWindowByType(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 5108dcfc3c890c2b7fee083e9f1cf80cf2b7e430..c582b66954675d34a6903ee19b58af7db6acdcd7 100755
--- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/model/WindowLayout.as
+++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/model/WindowLayout.as
@@ -136,25 +136,21 @@ 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 {
-      //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 + "]");
+//      trace("WindowLayout::setLayout for " + window.name + ",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);
 		}
diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/LayoutsCombo.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/LayoutsCombo.mxml
index 2cdc1a2acd599ef6fe060e82d386df549f06d059..630d562d5139a7658b3c75a44cbaa12d8c114e6e 100755
--- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/LayoutsCombo.mxml
+++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/LayoutsCombo.mxml
@@ -23,6 +23,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 			toolTip="{ResourceUtil.getInstance().getString('bbb.layout.combo.toolTip')}"
 			prompt="{ResourceUtil.getInstance().getString('bbb.layout.combo.prompt')}"
 			height="{LayoutButton.BUTTON_SIZE}" creationComplete="init()"
+			change="onSelectedItemChanged(event)"
 			disabledColor="{getStyle('color')}" rowCount="10"
 			styleName="languageSelectorStyle" >
 	
@@ -47,9 +48,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 			
 			import mx.collections.ArrayCollection;
 			import mx.controls.Alert;
-			import mx.controls.listClasses.ListBase;
-			import mx.events.DropdownEvent;
-			import mx.events.ListEvent;
 			import mx.events.ResizeEvent;
 			
 			import org.bigbluebutton.common.IBbbModuleWindow;
@@ -62,8 +60,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 			import org.bigbluebutton.core.events.SwitchedLayoutEvent;
 			import org.bigbluebutton.core.managers.UserManager;
 			import org.bigbluebutton.core.vo.LockSettingsVO;
-			import org.bigbluebutton.main.model.users.BBBUser;
-			import org.bigbluebutton.main.model.users.Conference;
 			import org.bigbluebutton.main.views.MainToolbar;
 			import org.bigbluebutton.modules.layout.events.ChangeLayoutEvent;
 			import org.bigbluebutton.modules.layout.events.ComboBoxCreatedEvent;
@@ -85,24 +81,26 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
       [Bindable] private var layoutNames:ArrayCollection = new ArrayCollection();
       
       private function init():void {
-        //trace(LOG + "initing");
+        trace(LOG + "initing");
         dataProvider = layoutNames;
         populateComboBox();
-        this.addEventListener(DropdownEvent.OPEN, openDropdownHandler);
         refreshRole(UsersUtil.amIModerator());
       }
       
       private function lockSettingsChanged(e:LockControlEvent):void {
-        refreshRole(UsersUtil.amIModerator());
+        var lockSettings:LockSettingsVO = UserManager.getInstance().getConference().getLockSettings();
+        if (UsersUtil.amIModerator() || UsersUtil.amIPresenter()) return;
+        
+        this.enabled = ! lockSettings.getLockedLayout();
       }
       
 			private function populateLayoutsList(e:LayoutsReadyEvent):void {
-        //trace(LOG + " handling layout ready event.");       
+        trace(LOG + " handling layout ready event.");       
         populateComboBox();
 			}
       
       private function populateComboBox():void {
-        //trace(LOG + " populating layout combo.");  
+        trace(LOG + " populating layout combo.");  
         layoutNames = new ArrayCollection();         
         var layouts:Array = LayoutModel.getInstance().getLayoutNames();
         
@@ -111,7 +109,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
           var translatedName:String = ResourceUtil.getInstance().getString(lay.name)
           if (translatedName == "undefined") translatedName = lay.name;
           var item:Object = {index: idx, label: translatedName, localeKey: lay.name, currentLayout: lay.currentLayout };
-          //trace(LOG + " layout [" + lay.name + ", current=" + lay.currentLayout + "]");
+          trace(LOG + " layout [" + lay.name + ", current=" + lay.currentLayout + "]");
           layoutNames.addItem(item);
           if (lay.currentLayout) {
             currentLayoutIndex = idx;
@@ -124,9 +122,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
       }
 						
 			private function onLayoutChanged(e:SwitchedLayoutEvent):void {	
-        //trace(LOG + " handling SwitchedLayoutEvent layout=[" + e.layoutID + "]");
+        trace(LOG + " handling SwitchedLayoutEvent layout=[" + e.layoutID + "]");
         populateComboBox();
-        //trace(LOG + " selected layout coming in is: " + selectedIndex);
+        trace(LOG + " selected layout coming in is: " + selectedIndex);
 				var idx:int = -1;					
 				for each (var obj:Object in dataProvider) {
 					if (obj.localeKey == e.layoutID)
@@ -140,20 +138,15 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 				}
 				invalidateDisplayList();
 				
-				//trace(LOG + " selected layout afterwards is: " + selectedIndex);
+				trace(LOG + " selected layout afterwards is: " + selectedIndex);
 			}
 			
 			private function localeChanged(e:LocaleChangeEvent):void {
-				//trace(LOG + " locale change recieved");
+				trace(LOG + " locale change recieved");
 				populateComboBox();
 			}
 			
-			private function openDropdownHandler(e:DropdownEvent):void {
-				// a new dropdown object is created everytime the menu is opened
-				this.dropdown.addEventListener(ListEvent.ITEM_CLICK, itemClickHandler);
-			}
-			
-			private function itemClickHandler(e:ListEvent):void {
+			private function onSelectedItemChanged(e:Event):void {
 				_dispatcher.dispatchEvent(new ChangeLayoutEvent(e.currentTarget.selectedItem.localeKey));
 			}
 					
@@ -163,9 +156,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 			}
 
 			public function refreshRole(amIModerator:Boolean):void {
-				var conference:Conference = UserManager.getInstance().getConference();
-				var thisUser:BBBUser = conference.getMyUser();
-				this.enabled = ! thisUser.lockedLayout || amIModerator;
+				var layoutLocked:Boolean = UserManager.getInstance().getConference().getLockSettings().getLockedLayout();
+				this.enabled = amIModerator || !layoutLocked;
 			}
 		]]>
 	</mx:Script>
diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/LockButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/LockButton.mxml
old mode 100755
new mode 100644
index bbae8a82b445704a1ea7d64765290376270f7777..a70d3a2b820f1d49572cad0f58a45bc6ee699f18
--- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/LockButton.mxml
+++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/LockButton.mxml
@@ -53,7 +53,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 			}
 			
 			private function onClick(e:Event):void {
-				//_dispatcher.dispatchEvent(new LayoutEvent(LayoutEvent.SYNC_LAYOUT_EVENT));
+				_dispatcher.dispatchEvent(new LayoutEvent(LayoutEvent.SYNC_LAYOUT_EVENT));
 			}
 			
 			private function onLockLayoutEvent(e:Event):void {