Index: _source/plugins/bidi/plugin.js
===================================================================
--- _source/plugins/bidi/plugin.js	(revision 6404)
+++ _source/plugins/bidi/plugin.js	(working copy)
@@ -51,13 +51,9 @@
 	function handleMixedDirContent( evt )
 	{
 		var editor = evt.editor,
-			chromeRoot = editor.container.getChild( 1 ),
 			directionNode = evt.data.path.block || evt.data.path.blockLimit;
 
-		if ( directionNode && editor.lang.dir != directionNode.getComputedStyle( 'direction' ) )
-			chromeRoot.addClass( 'cke_mixed_dir_content' );
-		else
-			chromeRoot.removeClass( 'cke_mixed_dir_content' );
+		editor.fire( 'contentDirChanged', directionNode ? directionNode.getComputedStyle( 'direction' ) : editor.lang.dir );
 	}
 
 	/**
@@ -278,3 +274,10 @@
  * @param {Object} eventData.node The element that is being changed.
  * @param {String} eventData.dir The new direction.
  */
+
+/**
+ * Fired when the language direction in the specific cursor position is changed
+ * @name CKEDITOR.editor#contentDirChanged
+ * @event
+ * @param {String} eventData The direction in the current position.
+ */
Index: _source/themes/default/theme.js
===================================================================
--- _source/themes/default/theme.js	(revision 6404)
+++ _source/themes/default/theme.js	(working copy)
@@ -168,6 +168,18 @@
 			// Disable browser context menu for editor's chrome.
 			container.disableContextMenu();
 
+			// Use a class to indicate that the current selection is in different direction than the UI.
+			editor.on( 'contentDirChanged', function( evt )
+			{
+				var func = ( editor.lang.dir != evt.data ? 'add' : 'remove' ) + 'Class';
+
+				container.getChild( 1 )[ func ]( 'cke_mixed_dir_content' );
+
+				// Put the mixed direction class on the respective element also for shared spaces.
+				var toolbarSpace = this.sharedSpaces && this.sharedSpaces[ this.config.toolbarLocation ];
+				toolbarSpace && toolbarSpace.getParent().getParent()[ func ]( 'cke_mixed_dir_content' );
+			});
+
 			editor.fireOnce( 'themeLoaded' );
 			editor.fireOnce( 'uiReady' );
 		},
