This thread continues a discussion re bug 844953
copy-clone-pasted node appears in other tab
https://bugs.launchpad.net/leo-editor/+bug/844953

The reported bug is the tip of a what is to me an extremely upsetting
iceberg, namely that Ubuntu Unity breaks menu handling that works when
running classic.

The problem, in effect, is that the (single) unity menu becomes the
most obnoxious kind of global variable, and apparently Unity does
*not* switch the menu properly.

This will cause problems for Leo only when using the qttabs gui.  In
that case, Leo carefully constructs separate menus for each tab, but
Unity subverts this plan: only the *last* menu that Leo creates
"takes".  The results can be catastrophic: menu commands act on the
wrong commander.

There is a fix.  The event handler that handles tab changes will have
to change a global g.app.currentCommander ivar.  All of Leo's menu
callbacks will then use g.app.currentCommander ivar *instead of* the
keyword "c" arg that Leo presently is so careful to bind properly.

I am infuriated by even the thought of such a hack.

The problem is that using event handlers to switch contexts is
fundamentally less sound than using permanent bindings.  Event
handlers are the most buggy part of any gui framework, and even when
they are bug free event handlers are subject to extremely subtle race
conditions.  Problems will be rare, but they will cause chaos when
they happen.  The problems can cause data loss by saving the wrong
data.

This is absolutely worst kind of "fix".  I am not going to do it with
a happy heart.

Do I have any real alternative?  Alas, I think not.

1. I hesitate to imagine what kind of hacks the Qt people would have
to insert in order to fix the Unity menu botch.  And even if a fix
were possible, it's not here now.

2. I am going to complain to the Ubuntu developers.  Also Linus
Torvalds.  But so what?  One can hope for a fix from Ubuntu, but
that's not going to solve the present problem.

3. I could say that Leo's qttabs gui is not supported on Unity, but
that is not good for Leo.

I'm going to cool off a bit before changing Leo's code.  I suppose
I'll use a g.unity_hack switch to enable the hack, but I just can't
bear to do that now.

Your comments please, Amigos.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to