mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-24 21:16:50 +03:00
Give the browser window widget input focus by defualt on startup.
svn path=/trunk/netsurf/; revision=10948
This commit is contained in:
parent
908da609e7
commit
71ea71540a
@ -400,6 +400,13 @@ void fbtk_writable_text(fbtk_widget_t *widget, fbtk_enter_t enter, void *pw);
|
||||
void fbtk_set_text(fbtk_widget_t *widget, const char *text);
|
||||
|
||||
|
||||
/** Give widget input focus.
|
||||
*
|
||||
* @param widget Widget to be given input focus.
|
||||
*/
|
||||
void fbtk_set_focus(fbtk_widget_t *widget);
|
||||
|
||||
|
||||
|
||||
|
||||
/** enable the on screen keyboard for input */
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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 */
|
||||
|
@ -1245,6 +1245,8 @@ create_normal_browser_window(struct gui_window *gw, int furniture_width)
|
||||
/* browser widget */
|
||||
create_browser_widget(gw, toolbar_height, option_fb_furniture_size);
|
||||
|
||||
/* Give browser_window's user widget input focus */
|
||||
fbtk_set_focus(gw->browser);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user