[freeplane] Keystrokes no longer recognised during use - Debian bug 714524

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[freeplane] Keystrokes no longer recognised during use - Debian bug 714524

OmegaPhil
From Felix Natter:

OmegaPhil <OmegaPhil00@startmail.com> writes:

> On 28/06/14 12:02, OmegaPhil wrote:
>> Package: freeplane Version: 1.2.23+dfsg1-1
>>
>>> Hi,
>>
>>> as written on another thread, it would be good to know if you can
>>>  reproduce the issue with another Java application like jedit 
>>> (packaged in Debian). This way we would know if it's a Java or 
>>> Freeplane/FreeMind issue.
>>
>>> Cheers, Eric
>>

hi OmegaPhil!

>> I have seen this now - the only other Java editing program that I 
>> knowingly use is Eclipse (which I have used for years) - this
>> doesnt have the problem.

AFAIK Eclipse does not use Java Swing but rather SWT, so it may
not be the best application to use for testing. JEdit seems simple,
maybe it's even easier to debug than Freeplane, I don't know.
 
>> I finally have Java progression now, so I am looking into killing
>> this problem. Currenty looking into how maven works and then how to

Ok, great to hear!

>> resolve dependencies in some sort of local Debian way (freeplane
>> does not build from source without some local maven mangling).

Are you trying to build master from here
  https://github.com/freeplane/freeplane
?

It may be easier to fix this in "1.3.x" branch, which definitely builds
with ant and without maven (IMHO master does not use maven yet, either?).

>
> Right, I have added debug code to
> org.freeplane.view.swing.ui.DefaultNodeKeyListener.keyPressed and
> keyTyped, and can trivially demonstrate the problem - after keeping
> freeplane busy moving nodes around on my C mindmap, at some point it
> gives up and keystrokes no longer reach DefaultNodeKeyListener.

If you can reproduce it, you will definitely get help from us!
(so far we haven't been able to reproduce it on our machines!)

> Currently due to starting Java progression with a different Java
> project, my main IDE for Java is NetBeans. freeplane defines maven
> dependencies that are not in the central repository (and don't appear
> to be made to work with the Debian maven-helper stuff):
>
> forms-1.0.5.jar: Very old

Where do you get forms-1.0.5.jar from?
I think we're using 1.2.1:
  https://github.com/freeplane/freeplane/blob/master/freeplane/lib/forms-1.2.1.jar

> freeplane-jortho-<freeplane version>.jar: No 'freeplane' directory
> exists in the central repository??

jortho is built from the freeplane sources.

> freeplane-simplyHTML--<freeplane version>.jar: Same

simplyhtml uses a versioning different from Freeplane.

> As these dependencies are unresolvable, NetBeans will not run or debug
> the project. I can see in the real installation that manifest files
> have been hacked to point to versionless jars in /usr/share/java, but
> it is too early for me to start hacking maven stuff as I've only just
> read into it today.
>
> How would you get NetBeans to run in this case?

Not sure whether we have NetBeans devs, but we can probably help you.

> Once I get breakpoints in, I expect to find a little bit more about
> the problem, but will probably decide Swing is screwing up. Then it is
> time to debug OpenJDK!!

I hope you only want to debug the Java part of OpenJDK 

> Thanks for any help.

*Please discuss all of this in our developer discussion forum*, where
all our devs listen and will (try to) help you:
  http://freeplane-developer.996965.n3.nabble.com/

(requires free registration)

Thanks for the initiative, Cheers and Best Regards,

Felix
-- Felix Natter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

OmegaPhil
From Felix Natter:

AFAIK Eclipse does not use Java Swing but rather SWT, so it may
not be the best application to use for testing. JEdit seems simple,
maybe it's even easier to debug than Freeplane, I don't know.
Acknowledged - I have played a little with jEdit, but I don't fancy sitting here for a few hours typing in junk to see if it happens ;)
 
Are you trying to build master from here
  https://github.com/freeplane/freeplane
?

It may be easier to fix this in "1.3.x" branch, which definitely builds
with ant and without maven (IMHO master does not use maven yet, either?).
No - I currently use the Debian-packaged version, so my first step was to 'apt-get source' and go from there. Clarification - I can build freeplane outside of NetBeans fine, following the readme instructions - but within NetBeans, when I look for a project to open, the main 'freeplane' directory registers as a maven project - so I opened and used it. The pom.xml file introduced in commit 40514aea91af24a4716e7196d7f66a7452c2a857 in 2009 is whats making it a maven project. Now I'm in git, I can see it has not been maintained, which probably answers my question... thats what NetBeans is picking up on to come up with the versions etc. The file probably wants removing if you don't use maven?

I will use git master and then add the dependencies as libraries according to NetBeans.

I hope you only want to debug the Java part of OpenJDK
What are you talking about, I'm looking forward to the C++
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

OmegaPhil
Right, I tried to create a NetBeans ant project and then add all the relevant src directories in, and the dependencies via '/usr/share/java', but some classes were still not resolving (e.g. 'com.jgoodies.forms.factories.ButtonBarFactory'), so I assume the installed jars are out of date. I don't like this approach as I can see from the maven configuration that all the top-level directories are their own projects with lib dirs etc - what I'm doing is a hack that I don't understand. Does anyone here use NetBeans with Freeplane?

I then moved to Eclipse, since that is documented - however this doesn't appear to work either. During the initial import, after selecting the top-level directory cloned from git ('freeplane-git' in my case), a list of projects didn't appear but just the one project associated with that directory. After the run configurations step, running the project failed:

Variable references non-existent resource : ${workspace_loc:freeplane/external-resources}
In the OSGi Framework run configuration, Under Arguments -> VM arguments, I changed to '-Dorg.freeplane.globalresourcedir=${workspace_loc:freeplane-git/freeplane/external-resources}', and I was in theory now able to run. However no GUI appeared, and only the following appeared in the console:

Configuration location:
    file:/mnt/Storage_1/Programming/Java/Eclipse Workspace/.metadata/.plugins/org.eclipse.pde.core/freeplane-osgi local/
Configuration file:
    file:/mnt/Storage_1/Programming/Java/Eclipse Workspace/.metadata/.plugins/org.eclipse.pde.core/freeplane-osgi local/config.ini loaded
Install location:
    file:/usr/lib/eclipse/
Framework located:
    file:/usr/lib/eclipse/plugins/org.eclipse.osgi_3.8.1.dist.jar
Framework classpath:
    file:/usr/lib/eclipse/plugins/org.eclipse.osgi_3.8.1.dist.jar
Debug options:
    file:/mnt/Storage_1/Programming/Java/Eclipse Workspace/debug.properties not found
Any ideas of how to start up Freeplane in Eclipse? I'd prefer NetBeans but happy to go down the Eclipse route as long as there is documentation...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

Felix Natter
Administrator
In reply to this post by OmegaPhil
hi OmegaPhil,

> What are you talking about, I'm looking forward to the C++

:-) the problem is _debugging_ the JDK C++ code ;-)

> I will use git master and then add the dependencies as libraries according to NetBeans.

You don't need/want to add stuff from /usr/share/java - the deps in working
versions are all committed in git!

>  'com.jgoodies.forms.factories.ButtonBarFactory'

Debian has JGoodies 1.6 while FP upstream uses JGoodies 1.2.1.
=> There is a patch in the Debian Package for that.

You don't need to adapt the OSGi config!

Here is the documentation on how to build from git + Eclipse:
  http://freeplane.sourceforge.net/wiki/index.php/Git_howto

(you need to read at least 1.1 and 1.2.2)

(I don't know whether
http://freeplane.sourceforge.net/wiki/index.php/Setup_Eclipse_for_coding is
up-to-date)

--> so either adapt the HOWTO for Netbeans + ask here _or_ just use Eclipse.

If you're having problems with master, try using branch "1.3.x".

Ask here if you have further problems!

Cheers and Best Regards,
Felix
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

Dimitry Polivaev
Administrator
In reply to this post by OmegaPhil
Hi Phil,


> Any ideas of how to start up Freeplane in Eclipse? I'd prefer NetBeans but happy to go down the
> Eclipse route as long as there is documentation...

thank you for all your efforts. Felix asked me to support you to with the debugging.

1. Download the complete version with all libs.  It is one of the following:

http://sourceforge.net/projects/freeplane/files/freeplane%20stable/freeplane_src-1.3.11.tar.gz
http://sourceforge.net/projects/freeplane/files/freeplane%20stable/archive/1.2.23/freeplane_src-1.2.23_01.tar.gz

However we do not support 1.2.x since 1.3.11 has been released, so for me it were better if you
could use the latest stable version.

2. Execute "ant build" at the top level directory of the source.

3. After build finishes without errors (warnings are ok, we actually do not care) start eclipse.
It must be the right eclipse package, I recommend eclipse standard from

http://www.eclipse.org/downloads/packages/eclipse-standard-44/lunar

Do not use any debian repos for that, they are never up to date.

4. Use new eclipse workspace, I had some troubles converting workspaces from older eclipse versions
and created new workspace for eclipse luna.

5. From eclipse execute File -> Import ->General ->Existing projects into Workspace and select the
top level directory of the source.

Import all projects except freeplane_mac, freeplane_ant

6. Now all projects must compile in eclipse without errors and you can run launch configuration
"freeplane-osgi" which must be among the imported projects at

Background info: Freeplane still does not use any kind of dependency management. One of the crew is
working on getting the build under gradle but until it happens we still check everything into the
code repository and into our full source distributions.

The maven pom file is obsolete and is not in use. We never used it. I was told that keeping it could
help some guys to get in easier, therefore it is not removed yet.

Debian does not have the full package and therefore you could have some work with dependencies.

May be page http://www.freeplane.org/wiki/index.php/Eclipse could help you. And please report how
you are going and ask questions, I want to help.

Regards,
Dimitry
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

OmegaPhil
Thankyou Felix, Dimitry - I have succeeded in getting a working Eclipse project with 4.4. Currently one of the main reasons I use Debian is the package management - things are available and properly maintained for me - so previously I used the packaged Eclipse. I know that its out of date, but thats apparently due to the program being poorly structured and then not caring for Debians requests to move things/clean stuff up so that files are stored in an acceptable hierarchy, making it a nightmare to package. Still, as a programmer its unacceptable for my IDE to create problems for me... so I have upgraded to a standalone installation.

I have gone with using the full stable v1.311 source as recommended, and I can confirm the problem still occurs. I'll be fighting it more later today.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

OmegaPhil
OK, most of today has been spent working on this - the problem is clearly with AWT (and I say AWT as this is dealing with the AWT-EventQueue and AWT events). The following is an example correct stacktrace for a key event:

Thread [AWT-EventQueue-0] (Suspended (breakpoint at line 36 in DefaultNodeKeyListener))
DefaultNodeKeyListener.keyPressed(KeyEvent) line: 36
RootMainView(Component).processKeyEvent(KeyEvent) line: 6463
RootMainView(JComponent).processKeyEvent(KeyEvent) line: 2819
RootMainView(Component).processEvent(AWTEvent) line: 6282
RootMainView(Container).processEvent(AWTEvent) line: 2229
RootMainView(Component).dispatchEventImpl(AWTEvent) line: 4861
RootMainView(Container).dispatchEventImpl(AWTEvent) line: 2287
RootMainView(Component).dispatchEvent(AWTEvent) line: 4687
DefaultKeyboardFocusManager(KeyboardFocusManager).redispatchEvent(Component, AWTEvent) line: 1895
DefaultKeyboardFocusManager.dispatchKeyEvent(KeyEvent) line: 762
DefaultKeyboardFocusManager.preDispatchKeyEvent(KeyEvent) line: 1027
DefaultKeyboardFocusManager.typeAheadAssertions(Component, AWTEvent) line: 899
DefaultKeyboardFocusManager.dispatchEvent(AWTEvent) line: 727
JFrame(Component).dispatchEventImpl(AWTEvent) line: 4731
JFrame(Container).dispatchEventImpl(AWTEvent) line: 2287
JFrame(Window).dispatchEventImpl(AWTEvent) line: 2719
JFrame(Component).dispatchEvent(AWTEvent) line: 4687
EventQueue.dispatchEventImpl(AWTEvent, Object) line: 735
EventQueue.access$200(EventQueue, AWTEvent, Object) line: 103
EventQueue$3.run() line: 694
EventQueue$3.run() line: 692
AccessController.doPrivileged(PrivilegedAction<T>, AccessControlContext) line: not available [native method]
ProtectionDomain$1.doIntersectionPrivilege(PrivilegedAction<T>, AccessControlContext, AccessControlContext) line: 76
ProtectionDomain$1.doIntersectionPrivilege(PrivilegedAction<T>, AccessControlContext) line: 87
EventQueue$4.run() line: 708
EventQueue$4.run() line: 706
AccessController.doPrivileged(PrivilegedAction<T>, AccessControlContext) line: not available [native method]
ProtectionDomain$1.doIntersectionPrivilege(PrivilegedAction<T>, AccessControlContext, AccessControlContext) line: 76
EventQueue.dispatchEvent(AWTEvent) line: 705
EventDispatchThread.pumpOneEventForFilters(int) line: 242
EventDispatchThread.pumpEventsForFilter(int, Conditional, EventFilter) line: 161
EventDispatchThread.pumpEventsForHierarchy(int, Conditional, Component) line: 150
EventDispatchThread.pumpEvents(int, Conditional) line: 146
EventDispatchThread.pumpEvents(Conditional) line: 138
EventDispatchThread.run() line: 91
When freeplane breaks, keyboard events aren't even turning up in the earliest useful method - 'EventQueue.dispatchEvent(AWTEvent) line: 705', even though mouse events work fine.

I also turned on 'java.awt' logging at the FINEST level and could see 0 keyboard events when the problem happens.

I have found by suspending the AWT EventQueue, spamming a load of keystrokes to freeplane, then resuming again, those KeyEvents register - they don't appear to actually change the mindmap but Java acknowledges them. I doubt it will solve this problem, but I am currently delving into these events to see if I can work out what breaks in this case.

I had hoped I could find a top-level event in the AWT stack that received everything and then demonstrate the brokenness somewhere lower down - isn't going to happen.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

Dimitry Polivaev
Administrator
> When freeplane breaks, keyboard events aren't even turning up in the earliest useful method -
> 'EventQueue.dispatchEvent(AWTEvent) line: 705', even though mouse events work fine.

There is one important issue to know.
When Freeplane becomes an event starting editing of existing node or creating a new node it captures
all following key input events in its own event queue until the node is created and the editing
component is available. Until this part was implemented there have been multiple reports that some
events were lost or used in wrong order. I have to admit that this implementation was a lot of trial
and error, but I do not see a flaw in its logic.


It performs it in a bit tricky way installing MTextController.eventQueue and releasing it only after
all captured events could be replayed to the new component in the right order. The installation
happens in call of EventBuffer.activate() and until KeyboardFocusManager.removeKeyEventDispatcher is
called from this class key events are caught in the queue and not processed.

I hope this information can help your investigations.

Best regards,
Dimitry
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

OmegaPhil
Thanks - I will review this tomorrow.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

OmegaPhil
This doesn't look relevant - org.freeplane.features.text.mindmapmode.EventBuffer.dispatchKeyEvent is never called - I'm not editing the nodes, just moving them up and down with Cntrl+UP/DOWN (takes <10 seconds of holding them down then changing to kill keyboard input).
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

OmegaPhil
Right, I have had new mesa, radeon driver and a reboot since - its harder to trigger the bug but it is still there.

I have finished looking into the keyboard events after I unsuspend the AWT event queue - DefaultKeyboardFocusManager.dispatchKeyEvent gets the 'focusOwner' before it eventually calls redispatchEvent, which then handles the keystrokes normally. In the bad case, getFocusOwner returns null which supposedly that means the keys are not comming from 'the same context as the calling thread' - at this point they are ignored.

Earlier in the process, FButtonBar.dispatchKeyEvent is called but is unable to set windowAncestor - the key events come from JFrame itself?

I don't think this situation is representative of the overall problem, so I am going to try to approach it a different way - I need to go beyond Java to see where these keystrokes are going (since Java says it doesn't get them at all...).
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

OmegaPhil
Christ, finally!!! I have the answer!!

I noticed ibus-daemon was wasting a lot of CPU cycles when I spammed the node moves. Waited until the moves stopped, then killed ibus. And I could use Freeplane again.

So for over a year, ibus has been buggering up Freeplane occassionally. While I am extremely relieved that I've finally solved this (ibus is there so that I can occassionally type in Japanese only), does anyone have experience with ibus? Since its taken so long to get to this point, I feel like just filing a bug and not taking the fight to it... unless someone here has experience and knows it wouldn't be that difficult.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

Felix Natter
Administrator
"OmegaPhil [via Freeplane Developer]"
<[hidden email]> writes:

> Christ, finally!!! I have the answer!!
>
> I noticed ibus-daemon was wasting a lot of CPU cycles when I spammed the node moves. Waited
> until the moves stopped, then killed ibus. And I could use Freeplane again.

Congratulations, these are the fruits of your hard work!!

> So for over a year, ibus has been buggering up Freeplane occassionally. While I am extremely
> relieved that I've finally solved this (ibus is there so that I can occassionally type in
> Japanese only), does anyone have experience with ibus? Since its taken so long to get to
> this point, I feel like just filing a bug and not taking the fight to it... unless someone
> here has experience and knows it wouldn't be that difficult.

Yes, you should try to file a bug report against ibus :-)

Cheers and Best Regards,
--
Felix Natter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

OmegaPhil
Of course, I will and have filled it, just a question of how hard it would be to take it on myself if anyone has experience. But, I have a number of other projects to get on with, so thats that.

Debian bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=753611

Thankyou Felix and Dimitry for your help with this :)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

OmegaPhil
OK, upstream has trivially recreated this issue using openjdk - he still says that it is Freeplane's problem, other than my basic statement that Freeplane doesnt do much with the keystrokes, can anyone else fight this accusation? Perhaps its time for an OpenJDK Debian bug...

If you want to recreate the problem, see here for instructions and a tiny POC mindmap.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

Dimitry Polivaev
Administrator
OmegaPhil,

could you please check if the bug still occurs in
https://sourceforge.net/projects/freeplane/files/do%20not%20use%20me/freeplane_bin-1.3.12_preXX.zip

I am sorry I do not have working linux myself now.

Dimitry
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

OmegaPhil
On 18/08/14 21:51, Dimitry Polivaev [via Freeplane Developer] wrote:

>
>
> OmegaPhil,
>
> could you please check if the bug still occurs in
> https://sourceforge.net/projects/freeplane/files/do%20not%20use%20me/freeplane_bin-1.3.12_preXX.zip
>
> I am sorry I do not have working linux myself now.
>
> Dimitry
Unfortunately I can confirm the bug still happens. I noticed that the
node moving is slower with this build too.



signature.asc (898 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

Dimitry Polivaev
Administrator
> I noticed that the
> node moving is slower with this build too.

No idea why it could be slower. Slower compared to which version? How exactly do you move the node?

Dimitry

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [freeplane] Keystrokes no longer recognised during use - Debian bug 714524

OmegaPhil
v1.3.11. Just Cntrl+UP/DOWN, as in the ibus bug report with the proof of
concept mindmap (https://code.google.com/p/ibus/issues/detail?id=1733#c5
attachment).

If this is going to take a huge amount of time further, I'm not sure
what the value is - this problem is googleable now and is fixable by
killing ibus/launching ibus in a specific way, and so far only affects
the libre Java runtime, so has limited impact.


On 19/08/14 20:22, Dimitry Polivaev [via Freeplane Developer] wrote:
>
>
>> I noticed that the node moving is slower with this build too.
>
> No idea why it could be slower. Slower compared to which version? How
> exactly do you move the node?
>
> Dimitry
>


signature.asc (898 bytes) Download Attachment
Loading...