diff options
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/browser.c | 26 | ||||
-rw-r--r-- | desktop/browser.h | 1 | ||||
-rw-r--r-- | desktop/gui.h | 12 |
3 files changed, 29 insertions, 10 deletions
diff --git a/desktop/browser.c b/desktop/browser.c index fbb91b02c..4d54e8bc4 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -383,16 +383,28 @@ void browser_window_set_drag_type(struct browser_window *bw, browser_drag_type type, struct rect *rect) { struct browser_window *top_bw = browser_window_get_root(bw); + gui_drag_type gtype; - if (type == DRAGGING_NONE) + bw->drag_type = type; + + if (type == DRAGGING_NONE) { top_bw->drag_window = NULL; - else + } else { top_bw->drag_window = bw; - bw->drag_type = type; + switch (type) { + case DRAGGING_SCR_X: + case DRAGGING_SCR_Y: + case DRAGGING_CONTENT_SCROLLBAR: + gtype = GDRAGGING_SCROLLBAR; + break; + default: + gtype = GDRAGGING_OTHER; + break; + } - /* TODO: inform front end that the core is handling drag, - * pass rect */ + gui_window_drag_start(top_bw->window, gtype, rect); + } } /* exported interface, documented in browser.h */ @@ -2554,10 +2566,8 @@ void browser_window_mouse_drag_end(struct browser_window *bw, switch (bw->drag_type) { case DRAGGING_SELECTION: - /* Drag handled by content handler */ - break; - case DRAGGING_OTHER: + case DRAGGING_CONTENT_SCROLLBAR: /* Drag handled by content handler */ break; diff --git a/desktop/browser.h b/desktop/browser.h index e7975d2f7..977396014 100644 --- a/desktop/browser.h +++ b/desktop/browser.h @@ -63,6 +63,7 @@ typedef enum { DRAGGING_FRAME, DRAGGING_SCR_X, DRAGGING_SCR_Y, + DRAGGING_CONTENT_SCROLLBAR, DRAGGING_OTHER } browser_drag_type; diff --git a/desktop/gui.h b/desktop/gui.h index dc2841fb8..dcb9160a5 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -41,6 +41,12 @@ typedef enum { GUI_SAVE_CLIPBOARD_CONTENTS } gui_save_type; +typedef enum { + GDRAGGING_NONE, + GDRAGGING_SCROLLBAR, + GDRAGGING_OTHER +} gui_drag_type; + struct gui_window; struct gui_download_window; struct browser_window; @@ -100,8 +106,10 @@ void gui_window_place_caret(struct gui_window *g, int x, int y, int height); void gui_window_remove_caret(struct gui_window *g); void gui_window_new_content(struct gui_window *g); bool gui_window_scroll_start(struct gui_window *g); -bool gui_window_box_scroll_start(struct gui_window *g, - int x0, int y0, int x1, int y1); + +bool gui_window_drag_start(struct gui_window *g, gui_drag_type type, + struct rect *rect); + void gui_window_save_link(struct gui_window *g, const char *url, const char *title); |