diff options
Diffstat (limited to 'framebuffer/fbtk')
-rw-r--r-- | framebuffer/fbtk/event.c | 4 | ||||
-rw-r--r-- | framebuffer/fbtk/fbtk.c | 12 |
2 files changed, 15 insertions, 1 deletions
diff --git a/framebuffer/fbtk/event.c b/framebuffer/fbtk/event.c index c1ddaeeb0..c1c4bc1ee 100644 --- a/framebuffer/fbtk/event.c +++ b/framebuffer/fbtk/event.c @@ -52,8 +52,10 @@ fbtk_input(fbtk_widget_t *root, nsfb_event_t *event) /* obtain widget with input focus */ input = root->u.root.input; - if (input == NULL) + if (input == NULL) { + LOG(("No widget has input focus.")); return; /* no widget with input */ + } fbtk_post_callback(input, FBTK_CBT_INPUT, event); } diff --git a/framebuffer/fbtk/fbtk.c b/framebuffer/fbtk/fbtk.c index 92586ebce..5aef6bd45 100644 --- a/framebuffer/fbtk/fbtk.c +++ b/framebuffer/fbtk/fbtk.c @@ -685,6 +685,18 @@ fbtk_post_callback(fbtk_widget_t *widget, fbtk_callback_type cbt, ...) return ret; } +/* exported function docuemnted in fbtk.h */ +void +fbtk_set_focus(fbtk_widget_t *widget) +{ + fbtk_widget_t *root; + + /* ensure we have the root widget */ + root = fbtk_get_root_widget(widget); + + root->u.root.input = widget; +} + /* exported function docuemnted in fbtk.h */ |