codehenry / xmonad

Automatically exported from code.google.com/p/xmonad
0 stars 0 forks source link

WM_TAKE_FOCUS problem when using matlab gui for Xmonad 0.9.1, cpu amd64, Ubuntu 10.04 LTS system #408

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Use "guide" command in matlab to generate a new gui.
2.Put a "edit text" component into the field.
3.Run the gui.

What is the expected output? What do you see instead?
The expected output should be that:
Man can choose (or focus on) the "edit text" component and change the content.
However the output I got was that:
The "edit text" component can not be focused at all, the focus is only on the 
tui window, so I can not change the content inside the "edit text" component.

What version of the product are you using? On what operating system?
The related version of the products are:
  CPU : amd64
  System : Ubuntu 10.04 LTS
  Xmonad : 0.9.1
  Matlab : R2010a
  Java : jre1.6.0_23

Are you using an xmonad.hs?  Please attach it and the output of "xmonad
--recompile".
I have two monitors, and I use the "gnomeConfig" instead of "defaultConfig", 
also the "wmname" has been set to "LG3D".
My "xmonad.hs" file can be found in the attachment.
By the way, it can compile and work fine, I just have this WM_TAKE_FOCUS 
problem.

Please provide any additional information below.
1. I'm aware that there was an issue 177 befoe, which can be found here:
http://code.google.com/p/xmonad/issues/detail?id=177
And it seems the "comment 33" has already resolved this problem.
However I'm pretty new for using Xmonad. The words there are totally unreadble 
for me.
Also I install Xmonad with "sudo aptitude install xmonad", and I cannot find 
the "Core.hs" mentioned in issue 177.
In addition, issue 177 was published in 2009, I don't konw whether it still 
work with Ubuntu 10.04 built-in xmonad or not.
Can anyone give me a step by step instruction please?
For example, go to which file and paste or change which part or which line.
Can I only change the "xmonad.hs" file to sovle this problem?

2. I don't have any java "gray box" problem, just the gui subcomponent can not 
be focused on.

3. I'm looking for the solution for a long time.
There is a solution to change jre "motif21" into "motif12" and then set the 
enviorment variable "AWT_TOOLKIT=MToolkit".
I have tested it, this solution only works for not amd64 pcs.
For amd64 pc, it does NOT work at all.

4. This is the most suprising part.
When starting the matlab with desktop, man can choose which jre they want to 
use. For me I choose "jre1.6.0_23", which means I start matlab in bash with 
command "export MATLAB_JAVA=~/jre1.6.0_23 && matlab".
I use jre1.6.0_23 because matlab built-in java will give a grey box under 
Xmonad.
With "jre1.6.0_23" the gui shows up, the gui "button" also works fine, only the 
"edit text" componet can no be focused.
And here comes the most suprising part :
If I use command "export MATLAB_JAVA=~/aaaaaaaaaa && matlab" to start matlab, 
where "~/aaaaaaaaaa" is a nonexisting directory, of course I cannot get a 
desktop because it cannot find any java.
But the gui now works perfectly.
It means although matlab lab hasn't been given any particular java path, it can 
still open gui and this time, the "edit text" component can be focused on and 
so changing the text inside is possible.
I don't understand why, but it happens.
Could anyone tell me why?

4. I also tried new "jdk 7", it cannot solve the problem.
Under "jdk 7", the gui is a "grey box", cannot show any components, also it 
makes matlab very very slow.

5. In addition, I tried "openjdk-6" instead of "jdk-6", again it doesn't work.

6. Of course, the "wmname" has already been set to "LG3D" in the "xmonad.hs" 
file.

Hope to get replys soon.
Thanks in advance!!

Original issue reported on code.google.com by lingyu.m...@googlemail.com on 27 Sep 2010 at 8:59

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the detailed investigation.

I can only help you try the patch on issue 177:

You have to build xmonad yourself. You can install to your home directory 
(provided you've got cabal-install, darcs, and some -dev versions of some X 
libraries, which should be available from distro repos):

darcs get http://code.haskell.org/xmonad
cd xmonad
darcs apply track-currently-processing-event.dpatch  # the patch at issue 177
cabal install

then for contrib (if you use it):

darcs get http://code.haskell.org/XMonadContrib
cd XMonadContrib
cabal install

Original comment by vogt.a...@gmail.com on 30 Sep 2010 at 12:12

GoogleCodeExporter commented 8 years ago
> 4. This is the most suprising part. If I use command "export 
MATLAB_JAVA=~/aaaaaaaaaa && matlab" to start matlab, where "~/aaaaaaaaaa" is a 
nonexisting directory, of course I cannot get a desktop because it cannot find 
any java. But the gui now works perfectly.

I believe Matlab ships with its own copy of the jvm, so perhaps in this 
situation it is defaulting to its own Java installation. It might be worth 
trying to find this and identify which version it is.

Original comment by daniel.w...@gmail.com on 30 Sep 2010 at 4:28

GoogleCodeExporter commented 8 years ago
At first, thanks for the help about the issue 177 patch.

About the matlab built-in jvm.
Yes, you're right, Matlab does have its own jvm.
However the built-in version jvm also have the WM_TAKE_FOCUS problem.
In addition, if man uses the "export MATLAB_JAVA=~/aaaaaaaaaa && matlab" 
command, matlab should NOT use the built-in jvm anymore.

Original comment by lingyu.m...@googlemail.com on 30 Sep 2010 at 7:15

GoogleCodeExporter commented 8 years ago
I have almost the same configuration (and problem) and the issue 177 advice 
appears to solve it (using xmonad and xmonad-contrib 0.10 from darcs.)

Original comment by klu...@gmail.com on 3 Jun 2011 at 4:01