Closed akrasuski1 closed 9 years ago
end-user's responsibility
There's no such thing.
What will happen with number edit in the second window when I open a main OS menu by pressing 1
?
The more I'm thinking about it, the more I'm leaning towards it. Problem you stated is not that bad - one can argue user should just finish typing in the number, and only then think about running other programs. But without window focus, we cannot have any kind of "press me, when you're ready" type of windows. And that's quite a big issue.
one can argue user should just finish typing in the number, and only then think about running other programs.
I think that even you will accidently hit 1 from time to time.
So the window focus, as I see it, should work as follows:
onFocus_window_nameofwindow
(for the first frame it has focus) and input_window_nameofwindow
(for all frames it has focus) or something to that effect. I don't really like it, since the widget creation is already complicated enough.
b) create a process function has_focus
and make widgets relying on user input check the focus status before processing any input.
I prefer option (b), but feel free to discuss.-3. That is not bad idea, but I think it would be rarely used. So I think we should do (a) anyway.
-5. Good point. I think focus should be actually a property of window and not process - otherwise we would have weird situations with child processes. I think adding another entry to os_data
structure, called current_focus
, with currently focused window index in it.
But still, there can be a utility function, saying whether a process' associated window has focus.
I think I've done it. Now I'm going to rewrite current widgets to support it and see what happens.
@akrasuski1 Is it safe to run it right now Or you are in the middle of a change?
You can test now, just don't expect that the windows respect their focus.
Now they do.
I don't think this one is needed, but I opened the issue for potential discussion. IMO it's widget-developer's and end-user's responsibility to ensure action groups don't collide.