Ticket #3721 (closed defect: fixed)

Opened 9 months ago

Last modified 8 months ago

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:

  1. MSG_CURSOR has one defined purpose. It shouldn't be piggybacked for other things. This causes trouble:
  1. 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

3721-clean-up-radio-widget-s-MSG_CURSOR.patch (1.6 KB) - added by mooffie 9 months ago.

Change History

Changed 9 months ago by mooffie

comment:1 Changed 9 months 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.)

Last edited 9 months ago by mooffie (previous) (diff)

comment:2 Changed 9 months 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

comment:3 Changed 8 months ago by andrew_b

  • Branch state changed from on review to approved

comment:4 Changed 8 months 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

comment:5 Changed 8 months ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.