summaryrefslogtreecommitdiff
path: root/framebuffer/fb_cursor.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2009-02-12 14:16:40 +0000
committerVincent Sanders <vince@netsurf-browser.org>2009-02-12 14:16:40 +0000
commit614de7d473b10710cb96d17e76c23a8ec7236b91 (patch)
tree940d69395a0edd49f33158a88f68743933b0d68c /framebuffer/fb_cursor.c
parent06ec51993ddf4e66feaf18464cbe8daaf8624e26 (diff)
downloadnetsurf-614de7d473b10710cb96d17e76c23a8ec7236b91.tar.gz
netsurf-614de7d473b10710cb96d17e76c23a8ec7236b91.tar.bz2
Fix window clipping and introduce concept of "root" framebuffer window to allow for navigation and status bars
svn path=/trunk/netsurf/; revision=6456
Diffstat (limited to 'framebuffer/fb_cursor.c')
-rw-r--r--framebuffer/fb_cursor.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/framebuffer/fb_cursor.c b/framebuffer/fb_cursor.c
index e2c066be7..cc6a30d42 100644
--- a/framebuffer/fb_cursor.c
+++ b/framebuffer/fb_cursor.c
@@ -35,6 +35,7 @@
#include "framebuffer/fb_bitmap.h"
#include "framebuffer/fb_cursor.h"
#include "framebuffer/fb_frontend.h"
+#include "framebuffer/fb_rootwindow.h"
struct fb_cursor_s {
int x;
@@ -262,11 +263,18 @@ fb_cursor_click(framebuffer_t *fb,
struct gui_window *g,
browser_mouse_state st)
{
+ /* check click lies within window */
+ if ((fb->cursor->x > g->x) &&
+ (fb->cursor->y > g->y) &&
+ (fb->cursor->x < g->x + g->width) &&
+ (fb->cursor->y < g->y + g->height)) {
browser_window_mouse_click(g->bw,
st,
- fb->cursor->x,
- fb->cursor->y + g->scrolly);
-
+ fb->cursor->x - g->x + g->scrollx,
+ fb->cursor->y - g->y + g->scrolly);
+ } else {
+ fb_rootwindow_click(st, fb->cursor->x, fb->cursor->y);
+ }
}
/*