summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2014-05-24 11:46:14 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2014-05-24 11:46:14 +0100
commit92d29c26d45553566baca64115ed24cb55a38f24 (patch)
tree74c9dbe5c3d728b9632e6825e91cc496e5a0bf5d
parent15d95ddcf83b3f4eded19ba8f3b4f7ddb130556a (diff)
downloadnetsurf-92d29c26d45553566baca64115ed24cb55a38f24.tar.gz
netsurf-92d29c26d45553566baca64115ed24cb55a38f24.tar.bz2
Stop treeview items moving when they've been dragged outside the treeview window.
-rw-r--r--amiga/tree.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/amiga/tree.c b/amiga/tree.c
index df6ac9bb3..04c799603 100644
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -304,18 +304,19 @@ void ami_tree_drag_end(struct treeview_window *twin, int x, int y)
BOOL drag;
nsurl *url = NULL;
const char *title = NULL;
+ bool ok = false;
if(drag = ami_drag_in_progress()) ami_drag_icon_close(twin->win);
if(drag && (twin != ami_window_at_pointer(AMINS_TVWINDOW)))
{
if((twin->type == AMI_TREE_HOTLIST) && (hotlist_has_selection())) {
- hotlist_get_selection(&url, &title);
+ ok = hotlist_get_selection(&url, &title);
} else if((twin->type == AMI_TREE_HISTORY) && (global_history_has_selection())) {
- global_history_get_selection(&url, &title);
+ ok = global_history_get_selection(&url, &title);
}
- if((title == NULL) || (title && (url == NULL))) {
+ if((ok == false) || (url == NULL)) {
DisplayBeep(scrn);
} else if(url) {
if(gwin = ami_window_at_pointer(AMINS_WINDOW)) {
@@ -331,9 +332,11 @@ void ami_tree_drag_end(struct treeview_window *twin, int x, int y)
hotlist_add_entry(url, title, true, y);
}
}
+ tree_mouse_action(twin->tree, twin->mouse_state | twin->key_state,
+ twin->drag_x, twin->drag_y); /* Keep the tree happy */
tree_drag_end(twin->tree, twin->mouse_state,
twin->drag_x, twin->drag_y,
- twin->drag_x, twin->drag_y); /* Keep the tree happy */
+ twin->drag_x, twin->drag_y); /* Keep the tree happier */
} else {
if(tree_drag_status(twin->tree) == TREE_UNKNOWN_DRAG)
DisplayBeep(scrn);