Am 24.04.22 um 09:09 schrieb Will Godfrey:
As the Resonance window already has an event handle, I experimented with
adding the controls to it. They worked perfectly apart from one thing. If
you undo the enabling of resonance itself the window loses focus and no
other part of Yoshimi gains it. Therefore no other keyboard undo/redo works!
Any thoughts on this?
Hi Will,
when the window is disabled, seemingly it can no longer fulfil its role to
handle events. Many windowing toolkits have special handing for such a case,
to somehow pass the event handling to a "parent window". However, Applications
designed to have multiple windows are notoriously tricky in many aspects, and
often require explicit coding for standard situations handled automatically
in a single-window application.
And my guess is that we're in such a situation here: we need to help the
windowing toolkit to get the focus right, since the windowing toolkit
does not know what is conceptually the parent window of resonance.
So my ascent would be to have some special handler function similar to the
"close with right click" in the child window; this special handler could
then first somehow transfer the focus to the parent proper and then
immediately disable the current window.
And then we'd need to intercept the undo messages at a sensible point
and just "rewrite" or "reroute" the enabling command and issue another
special command instead, which then activates the aforementioned
handler in the UI. Maybe it can even be coded into some special
property of the original "disable" command? Anyway, the command
needs to be adapted on the fly in that case.
Next I would consider where the best point is to do that intercepting
and rewriting. Intuitively, I would prefer do it at the decoding side,
i.e I would not tamper with the capturing and recording of UNDO info,
to keep that info generic and intact, which is always better on the
long run. Thus my question: is it possible to build a "checkpoint"
into the UNDO processing itself, when events are emitted? Is it
possible to let that checkpoint detect and rewrite specific
"disable XY" messages?
-- Hermann
_______________________________________________
Yoshimi-devel mailing list
Yoshimi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel