Ticket #3721 (closed defect: fixed)
Cleanup radio widget's MSG_CURSOR
Reported by: | mooffie | Owned by: | andrew_b |
---|---|---|---|
Priority: | minor | Milestone: | 4.8.19 |
Component: | mc-core | Version: | master |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | merged | Votes for changeset: | committed-master |
Description
While investigating #3719 I discovered a "bug" in the radio widget:
Whenever a key is pressed (MSG_KEY), the widget draws itself to reflect the new state. But instead of doing this drawing explicitly, it does this indirectly by focusing the widget in its MSG_CURSOR. This is a vestige from the old days.
I'm attaching a bug to fix this.
Why is this a problem? Because:
- MSG_CURSOR has one defined purpose. It shouldn't be piggybacked for other things. This causes trouble:
- One way to fix #3719 is simply by adding "case MSG_FOCUS: r->pos = r->sel". This resets the active item to the selected one whenever the user moves the focus to the widget. But since MSG_FOCUS is outrageously sent in MSG_CURSOR also, this reset will be done after each key press, which means that the active item is stuck...
Attachments
Change History
comment:1 Changed 8 years ago by mooffie
Another issue (independent of the above):
We should also replace the widget_set_state(WST_FOCUSED) with widget_redraw(), in case MSG_KEY: case ' ' (the patch at #3718 makes it send a proper notification). We may put a widget_set_state(WST_FOCUSED) in MSG_HOTKEY instead. (I'm not attaching a patch b/c I won't have time to check it right now.)
comment:2 Changed 8 years ago by andrew_b
- Status changed from new to accepted
- Owner set to andrew_b
- Votes for changeset set to andrew_b
- Branch state changed from no branch to on review
- Milestone changed from Future Releases to 4.8.19
Branch: 3721_radio_msg_cursor
changeset:6c47fa36d3b28d7795b2f00ab15a2e9fb46d92f5
comment:4 Changed 8 years ago by andrew_b
- Status changed from accepted to testing
- Votes for changeset changed from andrew_b to committed-master
- Resolution set to fixed
- Branch state changed from approved to merged
Merged to master: [effac4744974ab6327070330236fada475d7c723].