mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-17 23:14:18 +03:00
Stop cursor leaving the root widget and causing a segfault (Found by tlsa)
svn path=/trunk/netsurf/; revision=10957
This commit is contained in:
parent
0c0e2d6de3
commit
4cf27ef338
@ -134,6 +134,16 @@ fbtk_warp_pointer(fbtk_widget_t *widget, int x, int y, bool relative)
|
||||
cloc.y0 = y;
|
||||
}
|
||||
|
||||
/* ensure cursor location lies within the root widget */
|
||||
if (cloc.x0 < root->x)
|
||||
cloc.x0 = root->x;
|
||||
if (cloc.x0 > (root->x + root->width))
|
||||
cloc.x0 = (root->x + root->width);
|
||||
if (cloc.y0 < root->y)
|
||||
cloc.y0 = root->y;
|
||||
if (cloc.y0 > (root->y + root->height))
|
||||
cloc.y0 = (root->y + root->height);
|
||||
|
||||
if (root->u.root.grabbed == NULL) {
|
||||
/* update the pointer cursor */
|
||||
nsfb_cursor_loc_set(root->u.root.fb, &cloc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user