From acf46e01a8dfeaa03585e7add070cc93677d50bf Mon Sep 17 00:00:00 2001 From: Chris Young Date: Tue, 27 Jul 2010 21:41:21 +0000 Subject: Allow text selection dragging across (NetSurf) windows. DisplayBeep if it is dropped somewhere invalid. svn path=/trunk/netsurf/; revision=10665 --- amiga/clipboard.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'amiga/clipboard.c') diff --git a/amiga/clipboard.c b/amiga/clipboard.c index bf09f5f98..d84add7f2 100755 --- a/amiga/clipboard.c +++ b/amiga/clipboard.c @@ -257,17 +257,31 @@ bool gui_copy_to_clipboard(struct selection *s) void ami_drag_selection(struct selection *s) { struct box *text_box; - ULONG x = s->bw->window->shared->win->MouseX; - ULONG y = s->bw->window->shared->win->MouseY; + ULONG x; + ULONG y; + struct gui_window_2 *gwin = ami_window_at_pointer(); - if(text_box = ami_text_box_at_point(s->bw->window, &x, &y)) + if(!gwin) + { + DisplayBeep(scrn); + return; + } + + x = gwin->win->MouseX; + y = gwin->win->MouseY; + + if(text_box = ami_text_box_at_point(gwin, &x, &y)) { if(gui_copy_to_clipboard(s)) { - browser_window_mouse_click(s->bw, BROWSER_MOUSE_PRESS_1, x, y); - browser_window_key_press(s->bw, KEY_PASTE); + browser_window_mouse_click(gwin->bw, BROWSER_MOUSE_PRESS_1, x, y); + browser_window_key_press(gwin->bw, KEY_PASTE); } } + else + { + DisplayBeep(scrn); + } } bool ami_easy_clipboard(char *text) -- cgit v1.2.3