mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-04 16:44:14 +03:00
Add widget callback for getting stripped of focus. Call it in the input setter, on previous input holder.
This commit is contained in:
parent
daa47fce52
commit
72cb5b6ea4
@ -48,6 +48,7 @@ typedef enum fbtk_callback_type {
|
||||
FBTK_CBT_REDRAW,
|
||||
FBTK_CBT_DESTROY,
|
||||
FBTK_CBT_USER,
|
||||
FBTK_CBT_STRIP_FOCUS,
|
||||
FBTK_CBT_END,
|
||||
} fbtk_callback_type;
|
||||
|
||||
|
@ -729,6 +729,9 @@ fbtk_post_callback(fbtk_widget_t *widget, fbtk_callback_type cbt, ...)
|
||||
case FBTK_CBT_USER:
|
||||
break;
|
||||
|
||||
case FBTK_CBT_STRIP_FOCUS:
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -749,6 +752,13 @@ fbtk_set_focus(fbtk_widget_t *widget)
|
||||
/* ensure we have the root widget */
|
||||
root = fbtk_get_root_widget(widget);
|
||||
|
||||
if (root->u.root.input != NULL &&
|
||||
root->u.root.input != widget) {
|
||||
/* inform previous holder of focus that it's being stripped
|
||||
* of focus */
|
||||
fbtk_post_callback(root->u.root.input, FBTK_CBT_STRIP_FOCUS);
|
||||
}
|
||||
|
||||
root->u.root.input = widget;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user