diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2010-10-24 17:51:00 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2010-10-24 17:51:00 +0000 |
commit | bdf3c32f44880fd36c2fe66966863626b95e5d2d (patch) | |
tree | b66c9f8f4f503654a563b1295c17f787dff5fb52 | |
parent | 43e5a16b34cf6b9d2404bd9ace2be7e1b6bbb821 (diff) | |
download | netsurf-bdf3c32f44880fd36c2fe66966863626b95e5d2d.tar.gz netsurf-bdf3c32f44880fd36c2fe66966863626b95e5d2d.tar.bz2 |
Only allow auto-scroll on selection and selection drags
svn path=/trunk/netsurf/; revision=10904
-rw-r--r-- | amiga/download.c | 13 | ||||
-rwxr-xr-x | amiga/download.h | 2 | ||||
-rwxr-xr-x | amiga/gui.c | 4 | ||||
-rwxr-xr-x | amiga/gui.h | 1 | ||||
-rwxr-xr-x | amiga/tree.c | 4 |
5 files changed, 20 insertions, 4 deletions
diff --git a/amiga/download.c b/amiga/download.c index dd5755310..15a0286d5 100644 --- a/amiga/download.c +++ b/amiga/download.c @@ -369,6 +369,7 @@ void gui_drag_save_selection(struct selection *s, struct gui_window *g) { ami_drag_icon_show(g->shared->win, "ascii"); + ami_autoscroll = TRUE; drag_save_data = s; drag_save = GUI_SAVE_TEXT_SELECTION; } @@ -380,7 +381,8 @@ void ami_drag_save(struct Window *win) char *source_data; ULONG source_size; - if(drag_icon) ami_drag_icon_close(); + if(drag_icon) ami_drag_icon_close(NULL); + ami_autoscroll = FALSE; if(strcmp(option_use_pubscreen,"Workbench") == 0) { @@ -554,9 +556,16 @@ void ami_drag_icon_move(void) drag_icon_width, drag_icon_height); } -void ami_drag_icon_close(void) +/** + * Close the drag icon (invisible) window if it is open + * + * \param win pointer to window to clear drag pointer + */ + +void ami_drag_icon_close(struct Window *win) { if(drag_icon) CloseWindow(drag_icon); + if(win) ami_update_pointer(win, GUI_POINTER_DEFAULT); drag_icon = NULL; } diff --git a/amiga/download.h b/amiga/download.h index 782a414c8..66ddf490a 100755 --- a/amiga/download.h +++ b/amiga/download.h @@ -50,7 +50,7 @@ void ami_download_window_abort(struct gui_download_window *dw); BOOL ami_download_window_event(struct gui_download_window *dw); void ami_drag_save(struct Window *win); void ami_drag_icon_show(struct Window *win, char *type); -void ami_drag_icon_close(void); +void ami_drag_icon_close(struct Window *win); void ami_drag_icon_move(void); void ami_free_download_list(struct List *dllist); void ami_superimpose_favicon(STRPTR path, struct hlcache_handle *icon, STRPTR type); diff --git a/amiga/gui.c b/amiga/gui.c index bcd0c0365..92208bd6b 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -1027,7 +1027,9 @@ void ami_handle_msg(void) width=bbox->Width; height=bbox->Height; - if(gwin->mouse_state & BROWSER_MOUSE_DRAG_ON) + if(gwin->mouse_state & BROWSER_MOUSE_DRAG_ON && + ((gwin->bw->drag_type == DRAGGING_SELECTION) || + ami_autoscroll == TRUE)) { int drag_x_move = 0, drag_y_move = 0; diff --git a/amiga/gui.h b/amiga/gui.h index 70c1d2db3..3743ff9fd 100755 --- a/amiga/gui.h +++ b/amiga/gui.h @@ -145,4 +145,5 @@ bool win_destroyed; struct browser_window *curbw; struct gui_globals browserglob; uint32 ami_appid; +BOOL ami_autoscroll; #endif diff --git a/amiga/tree.c b/amiga/tree.c index 0119c0f7e..f39df7285 100755 --- a/amiga/tree.c +++ b/amiga/tree.c @@ -50,6 +50,8 @@ #include "desktop/history_global_core.h" #include "desktop/hotlist.h" #include "amiga/sslcert.h" +#include "amiga/download.h" /* drag icon stuff */ +#include "amiga/theme.h" /* pointers */ #include "utils/utils.h" #define AMI_TREE_MENU_ITEMS 19 @@ -793,6 +795,7 @@ BOOL ami_tree_event(struct treeview_window *twin) } else { + ami_drag_icon_close(twin->win); tree_drag_end(twin->tree, twin->mouse_state, twin->drag_x, twin->drag_y, x, y); } @@ -808,6 +811,7 @@ BOOL ami_tree_event(struct treeview_window *twin) } else { + ami_drag_icon_close(twin->win); tree_drag_end(twin->tree, twin->mouse_state, twin->drag_x, twin->drag_y, x, y); } |