ryanqq / macwidgets

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

window focus listener not installed #169

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. UnifiedToolBar toolBar =  UnifiedToolBar();
2. myComponent.add(toolBar);
3. start app

What is the expected output? What do you see instead?
WindowFocusListener should be added to toolBar's parent, causing toolBar to be 
painted in focused state upon start up.

 What do you see instead?
toolBar is painted in disabled or inactive state upon start up. in fact, it 
appears the WindowFocusListener never is added to toolBar's parent (repainting 
upon focus change is visibly choppy/delayed)

What version of the product are you using? On what operating system?
0.9.5 library, Mac OS X 10.5.8,  java 1.6.0_17

Please provide any additional information below.
Implementing this on my own, I found success when instead of using a 
weakReference to the WindowFocusListener when creating an AncestorListener, I 
used the WindowFocusListener (see WindowUtils.java)

I'm suspect of this bug, considering it would be obvious to anyone using your 
library and would have already been a tracked bug... can anyone reproduce this? 
I'm also don't understand why the weak reference is used.

finally, Thanks a lot for this great open source project, I have learned a lot 
by scouring your source code and it has helped a great deal on the project I 
was unfortunately far into before I discovered this project.

Thanks,
Seth

Original issue reported on code.google.com by seth.sch...@gmail.com on 21 Aug 2010 at 11:47

GoogleCodeExporter commented 9 years ago
As you suggest, the focus painting doesn't seem to work. I am attaching a patch 
I used to fix it in our environment.

Original comment by garrick....@gmail.com on 17 Nov 2010 at 6:52

Attachments: