[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

Re: [XaraXtreme-dev] Galleries and focus handling



Neil Howe wrote:
I believe focus handling took a long time to get right in the Windows version originally (and in fact it’s not perfect today). Presumably the correct behaviour is that the window with focus should process all events that are meaningful to it and pass all others on. So if the layer gallery for example doesn’t do anything with function key events (as it shouldn’t) it should pass them on so that tool selection still works.

I think it's a bit more subtle than that. Take a gallery with a combo
box in with selected text, or a dialog with a text field in. What
should CTRL-C do? Copy an object on the page? Or (if text is selected)
copy the selected text. And if text isn't selected, should it clear
the clipboard, or copy the object on the page?

Given some long-life dialogs (e.g. the colour editor) and bars (e.g.
the selector tool info bar) have text fields, this is pretty relevant.

The fact the new galleries aren’t working in this way in LX implies that we’re not getting this ‘pass on unused events’ behaviour by default. All non-modal windows should work this way, so do we need to do some work at the framework level to make it happen? Or is this something that needs to be implemented on a window by window basis?

I think it's just the same old hack with the controls that Luke did to
make bar stuff work, isn't it? IE if a /control/ has focus, and it's
not one which we think is interested in keys, pass the key to the main
frame. This means we can't (say) use the space-bar to toggle
a check-box (I presume) as they are not on Luke's list.

I don't galleries themselves are particularly interested in any keyboard
shortcuts, are they?

Note that a gallery is really just a dialog. There should be no special
keyboard handling required for galleries that is different to other
dialogs or bars (as far as I can see). Info bars and long lived dialogs
seem to me to present exactly the same problem space.

Alex