- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Options: Disabled status not toggled immediately #3716
Comments
This is because of a newfangled change. The checkbox does:
but the dialog checks:
It checks for parm==MSG_FOCUS, not parm==MSG_KEY. (There are more places like this.)
@andrew: I see that focusing a widget sends the dialog a MSG_NOTIFY. Is this really needed? |
|
Replying to mooffie:
Really needed what? Send some message to dialog? Definitely yes. Send a MSG_NOTIFY? Let's discuss.
When I wrote [c37f9b7] I had a choice between MSG_NOTIFY and MSG_FOCUS/MSG_UNFOCUS. MSG_(UN)FOCUS have the only sense: these messages are sent to change widget's focus state. In this logic, if you send MSG_(UN)FOCUS to a dialog, it should change it's focus state. Currently dialog can't be (un)focused because it's unused and not implemented, but it is not a reason to send MSG_(UN)FOCUS to a dialog. Therefore I applied MSG_NOTIFY to notify widget's owner about changing focus of a widget.
I can't agree with usage of MSG_KEY instead of MSG_FOCUS as parameter of MSG_NOTIFY because key is just one of two cases of (un)focusing. The second key is mouse. Perhaps we should create a special message (say, MSG_CHANGE_FOCUS). |
Ideally I should respond after studying the recent API changes, but since I may be away from the computer for a day or two I'll give, for the meantime, my quick uninformed reading of the situation (so don't let it raise your blood pressure!):
Are you sure your wording is exact? I thought its meaning now would be to tell the widget: "You've just (lost)received the focus!". The widget, I thought, has already got its state (WST_FOCUSED) changed by this point. It'd be followed by MSG_DRAW. Again: I'll need to study the code.
In the past I suggested to break MSG_FOCUS into MSG_QUERY_FOCUS ("tell me, are you able to receive the focus?", to which it should answer yes/no) and MSG_GOT_FOCUS ("You've just received the focus!", to which it won't need to answer). (This MSG_GOT_FOCUS could be renamed "MSG_FOCUS", as before.) Similarly with MSG_UNFOCUS.
My patches weren't meant to be committed. They were just a way to quickly show what caused the bug.
|
Replying to mooffie:
You can start from [5ac1c5a].
Yes, this is a typo. s/second key/second case
Exactly. MSG_NOTIGY is the general message, it doesn't depend upon event source. The name MSG_KEY means the keyboard as source. |
|
|
Great. I'm relieved to see the new MSG_CHANGED_FOCUS.
What I still don't like is the parm == MSG_KEY / MSG_WHATEVER accompanying MSG_NOTIFY, and here's why:
I see MSG_NOTIFY as a "high level" event. Or, using other words, "application level". Or, if you will, "semantic event". Most other events are low-level: they have to do with the implementation of the widget system.
Users of MSG_NOTIFY are supposed to be interested in semantic stuff like "value has changed", "data is ready", etc. I don't see what low-level stuff like MSG_KEY (or, previously, MSG_FOCUS) has to do with this. Seems like mixing oranges with East Siberian bears. MSG_NOTIFY was supposed, I believed, to free users from having to work with exactly this sort of low level mechanics; to make them able to concentrate on just what they want. |
Why is it necessary for these boxes.c dialogs to check that their radios/checboxes were modified by the keyboard and not, say, by the mouse? |
Replying to mooffie:
I applied patch as is to fix bug in short time.
In general, I agree. WCheck and WRadio send MSG_NOTIFY in the only one case: when state is changed. Therefore we can omit parm == MSG_KEY / MSG_WHATEVER. I'll make it in the cleanup branch. |
Important
This issue was migrated from Trac:
egmont
(@egmontkob)Go to Options -> Configuration. Toggle "Single press" (either with keyboard or with mouse).
Expected: "Timeout" immediately becomes enabled/disabled accordingly.
Actual: "Timeout" becomes properly enabled/disabled only after the focus leaves and then re-enters "Single press".
The same goes for other potentially disabled fields as well, i.e. Layout -> Equal split, and Virtual FS -> Always use ftp proxy.
Note
Original attachments:
mooffie
(@mooffie) onNov 6, 2016 at 3:32 UTC
The text was updated successfully, but these errors were encountered: