MATLAB: Does R2013b keyboard freeze when toggling X11 forwarded windows

2013bfrozenkeyboardputtysshxming

Background: I'm accessing R2013b on a remote Linux server from Windows 7 via X11 forwarding (Xming and PuTTY). From the shell command line, I start Matlab with: matlab2013b &. Nothing fancy.
The problem: R2013b loads appropriately: I can enter commands in the command window with the keyboard. When I toggle window focus (for example, I click on a Matlab figure window or on the Windows 7 desktop background and then back to the command window), the command window regains focus. Although the toggled-focus command window accepts mouse-click input, such as highlighting text, no flashing cursor appears at the command line and keyboard input is not displayed. At this point I cannot continue using Matlab and I must kill the process.
Other information: I have tried the above on multiple Win7 machines with the same result. The problem did not arise when accessing the remote machine from a Linux machine via ssh -X in a terminal window. The problem did not arise when running matlab2012b.

Best Answer

I received a helpful answer from the Matlab support to a Service Request I submitted. Basically you got two options that might help:
1) trying a different X server such as: http://mobaxterm.mobatek.net 2) updating Java to version 7 update 60.
For me the first option fixed all the issues and I can really recommend the mobaXterm ssh-terminal.
Here is the full answer I received:
_"Hello Moritz,
I am writing in reference to your Service Request, Case #01009102 regarding 'Keyboard Freeze during X11-forwarding'.
Apologies for the delay in your answer. MATLAB is tested on machines that contain a local and default installation of the the relevant operating system. Excepting compilers for use with MEX functionality, no additional packages are installed on these machines. Please note that the implementation of X11 on the Linux machines used for testing will vary and depends which implementation the Linux distribution on that machine uses. For example, in the case of Debian, this implementation is based on Xorg. We do not support the use of MATLAB with, for example, XFree86.
The operating system and the machine must meet the requirements of the particular release of MATLAB in question. For specifics, please refer to the following link:
Third-party X-servers and X-forwarding are not supported and are not guaranteed to work. More broadly, MathWorks does not guarantee that MATLAB will use of any particular method for graphics rendering. The techniques that are used depend the component, platform, and release. For MATLAB 7.14 (R2012a) on Linux, MATLAB graphics rest on components, such as Java that are implemented in X11.
For your case in particular the behavior your experience has been observed with the following combination:
- MATLAB 8.2 (R2013b) - Windows local machine - Linux remote machine - Xming Server or Cygwin X11 on the Window PC - SSH tunnel X11 forwarding using PuTTY
This appears to be an issue with Java 7 that did not exist in Java 6. MATLAB R2013b is the first version of MATLAB that uses Java 7. The Development team has been made aware of the same.
Some workarounds that have been known to work for few customers are:-
1) trying a different X server such as: http://mobaxterm.mobatek.net 2) updating Java to version 7 update 60.
However, please note that updating the Java version is not a supported workflow. To verify that MATLAB is using the correct version of the JVM software, type the following at the MATLAB prompt:
>> version -java
Information on how to do this upgrade can be found in the following link:
(The link refers to Mac OS X but the work-flow is the same for Linux)_