Ticket #3721 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years 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 8 years ago.

Change History

Changed 8 years ago by mooffie

comment:1 Changed 8 years ago by mooffie

I believe we should also replace the widget_set_state(WST_FOCUSED) with widget_redraw(), in case MSG_KEY: case ' '. 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.)

Version 0, edited 8 years ago by mooffie (next)

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

comment:3 Changed 8 years ago by andrew_b

  • Branch state changed from on review to approved

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

comment:5 Changed 8 years ago by andrew_b

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