mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-03 19:31:55 +03:00
Ensure selection related keypresses go to whatever has claimed input.
This commit is contained in:
parent
70d83baa6d
commit
4aadb5237a
@ -127,6 +127,12 @@ bool browser_window_key_press(struct browser_window *bw, uint32_t key)
|
||||
|
||||
assert(bw->window != NULL);
|
||||
|
||||
if (focus->caret_callback) {
|
||||
/* Pass keypress onto anything that has claimed input focus */
|
||||
return focus->caret_callback(focus, key,
|
||||
focus->caret_p1, focus->caret_p2);
|
||||
}
|
||||
|
||||
/* keys that take effect wherever the caret is positioned */
|
||||
switch (key) {
|
||||
case KEY_SELECT_ALL:
|
||||
@ -151,12 +157,7 @@ bool browser_window_key_press(struct browser_window *bw, uint32_t key)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* pass on to the appropriate field */
|
||||
if (!focus->caret_callback)
|
||||
return false;
|
||||
|
||||
return focus->caret_callback(focus, key,
|
||||
focus->caret_p1, focus->caret_p2);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user