mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-09-06 18:05:39 +00:00
data-device: Don't make a weston_coord with no valid space
We already only conditionally use base.offset when an icon exists. We should also avoid trying to create a coordinate with a NULL icon, as it will fire an assert(). Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
parent
14220a5f80
commit
815a560dd4
|
@ -968,6 +968,7 @@ weston_pointer_start_drag(struct weston_pointer *pointer,
|
|||
icon->committed_private = drag;
|
||||
weston_surface_set_label_func(icon,
|
||||
pointer_drag_surface_get_label);
|
||||
drag->base.offset = weston_coord_surface(0, 0, icon);
|
||||
} else {
|
||||
drag->base.icon = NULL;
|
||||
}
|
||||
|
@ -986,7 +987,6 @@ weston_pointer_start_drag(struct weston_pointer *pointer,
|
|||
if (keyboard)
|
||||
weston_keyboard_start_grab(keyboard, &drag->base.keyboard_grab);
|
||||
|
||||
drag->base.offset = weston_coord_surface(0, 0, icon);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1032,6 +1032,7 @@ weston_touch_start_drag(struct weston_touch *touch,
|
|||
icon->committed_private = drag;
|
||||
weston_surface_set_label_func(icon,
|
||||
touch_drag_surface_get_label);
|
||||
drag->base.offset = weston_coord_surface(0, 0, icon);
|
||||
} else {
|
||||
drag->base.icon = NULL;
|
||||
}
|
||||
|
@ -1051,7 +1052,6 @@ weston_touch_start_drag(struct weston_touch *touch,
|
|||
|
||||
drag_grab_touch_focus(drag);
|
||||
|
||||
drag->base.offset = weston_coord_surface(0, 0, icon);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue