Ticket #3766 (closed defect: fixed)
add_widget() doesn't remove focus from the previously focused widget
Reported by: | mooffie | Owned by: | mooffie |
---|---|---|---|
Priority: | major | Milestone: | 4.8.19 |
Component: | mc-core | Version: | master |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | merged | Votes for changeset: | committed-master |
Description
The problem:
When adding a new widget to a dialog, at runtime, add_widget() sets WST_FOCUSED on the new widget, but doesn't clear it from the previously focused widget. The result is two (or more) widgets that think they're the focused ones.
Seeing it:
Open the editor with some file. [You can use the mouse to carry out the following steps.] Turn off fullscreen for this WEdit and make is smaller. Now open another file in this same dialog (e.g., press C-n for a new file), and for this new WEdit too turn off fullscreen. Make this WEdit smaller so you can see the frames of both WEdits. You'll see that both frames have the color designated for a focused WEdit. Play with the mouse in both frames and you'll see that the problem gets fixed.
Note
The actual function is add_widget_autopos(), and that's how it's written in the commit message. For the ticket I wanted something "easier" in the title.
Attachments
Change History
comment:1 Changed 8 years ago by zaytsev
LGTM, only "in runtime", I think, is a typo in the original comment, and it should have been "at runtime", shouldn't it?
comment:2 Changed 8 years ago by mooffie
(Right. I didn't want to fix the "in runtime" already there, in case this patch got rejected, so I doubled it as a signpost. If I get to commit this I'll fix the two errors.)
comment:3 Changed 8 years ago by mooffie
- Owner set to mooffie
- Status changed from new to accepted
- Branch state changed from no branch to on review
branch: 3766_add_widget_autopos
changeset:d031efb7f3ead623e92050529f71eda801739ede
comment:4 Changed 8 years ago by andrew_b
I propose another way: use widget_select() that changes focus and sets pointer to the new current widget.
Changed 8 years ago by andrew_b
- Attachment 0001-Ticket-3766-add_widget_autopos-doesn-t-remove-focus-.patch added
comment:7 follow-up: ↓ 8 Changed 8 years ago by mooffie
I'm back! My flu is almost over.
@Andrew: I checked your patch and it works. Do you want me to commit it? (if you want me to also rename 'current' to 'new_current' (I think it'd be clearer), say so.)
comment:8 in reply to: ↑ 7 Changed 8 years ago by andrew_b
Replying to mooffie:
Do you want me to commit it? (if you want me to also rename 'current' to 'new_current' (I think it'd be clearer), say so.)
Yes, please.
comment:10 Changed 8 years ago by mooffie
- Milestone changed from Future Releases to 4.8.19
branch: 3766_add_widget_autopos
changeset:e83409b6d77a24b75e9d1d2f69ad96bc1c3d83f2
comment:12 Changed 8 years ago by mooffie
- Status changed from accepted to testing
- Votes for changeset set to committed-master
- Resolution set to fixed
- Branch state changed from approved to merged
Merged to master: [25b4096acec22cdb125e2e006b7435817b851934]