diff options
| author | Ted Gould <ted@gould.cx> | 2009-11-29 19:01:07 +0000 |
|---|---|---|
| committer | Ted Gould <ted@gould.cx> | 2009-11-29 19:01:07 +0000 |
| commit | 29d3c0b15028e61f176df3a75189bf0959d0d03e (patch) | |
| tree | 727afe596c693a9bdd098d72618abd9ceb0d1969 /src/zoom-context.cpp | |
| parent | Add the build dir dbus directory to grab some headerfiles for distcheck. (diff) | |
| parent | hopefully fix build on linux (diff) | |
| download | inkscape-29d3c0b15028e61f176df3a75189bf0959d0d03e.tar.gz inkscape-29d3c0b15028e61f176df3a75189bf0959d0d03e.zip | |
Merging in from trunk
(bzr r8254.1.37)
Diffstat (limited to 'src/zoom-context.cpp')
| -rw-r--r-- | src/zoom-context.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/zoom-context.cpp b/src/zoom-context.cpp index 2f0185731..f8212069e 100644 --- a/src/zoom-context.cpp +++ b/src/zoom-context.cpp @@ -18,6 +18,7 @@ #include "macros.h" #include "rubberband.h" +#include "display/sp-canvas-util.h" #include "desktop.h" #include "pixmaps/cursor-zoom.xpm" #include "pixmaps/cursor-zoom-out.xpm" @@ -86,7 +87,14 @@ static void sp_zoom_context_init (SPZoomContext *zoom_context) static void sp_zoom_context_finish (SPEventContext *ec) { + SPZoomContext *zc = SP_ZOOM_CONTEXT(ec); + ec->enableGrDrag(false); + + if (zc->grabbed) { + sp_canvas_item_ungrab(zc->grabbed, GDK_CURRENT_TIME); + zc->grabbed = NULL; + } } static void sp_zoom_context_setup(SPEventContext *ec) @@ -119,6 +127,8 @@ static gint sp_zoom_context_root_handler(SPEventContext *event_context, GdkEvent { SPDesktop *desktop = event_context->desktop; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + + SPZoomContext *zc = SP_ZOOM_CONTEXT(event_context); tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100); double const zoom_inc = prefs->getDoubleLimited("/options/zoomincrement/value", M_SQRT2, 1.01, 10); @@ -147,6 +157,12 @@ static gint sp_zoom_context_root_handler(SPEventContext *event_context, GdkEvent desktop->zoom_relative_keep_point(button_dt, zoom_rel); ret = TRUE; } + + sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate), + GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK, + NULL, event->button.time); + zc->grabbed = SP_CANVAS_ITEM(desktop->acetate); + break; } @@ -188,6 +204,12 @@ static gint sp_zoom_context_root_handler(SPEventContext *event_context, GdkEvent ret = TRUE; } Inkscape::Rubberband::get(desktop)->stop(); + + if (zc->grabbed) { + sp_canvas_item_ungrab(zc->grabbed, event->button.time); + zc->grabbed = NULL; + } + xp = yp = 0; escaped = false; break; |
